home *** CD-ROM | disk | FTP | other *** search
/ Mac Power 1997 January / macpower199701.bin / AMUG / Publishing_19 / Alpha 6.5.sit / Help / Perl Commands < prev    next >
MacBinary  |  1996-03-03  |  264.5 KB  |  [TEXT/ALFA]

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: MacBinary (archive/macBinary).

You can browse this item here: Perl Commands

ConfidenceProgramDetectionMatch TypeSupport
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Sun Mar 3 09:35:55 1996, modified Sun Mar 3 09:35:55 1996, creator Alpha editor, type ASCII, 230603 bytes "Perl Commands" , at 0x3854b 40019 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[ALFA]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0d 50 65 72 6c 20 43 | 6f 6d 6d 61 6e 64 73 00 |..Perl C|ommands.|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 41 4c 46 | 41 01 00 00 00 00 00 00 |.TEXTALF|A.......|
|00000050| 00 00 00 00 03 84 cb 00 | 00 9c 53 ad 5f 5e cb ad |........|..S._^..|
|00000060| 5f 5e cb 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |_^......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 13 41 00 00 |........|.....A..|
|00000080| 0d 4e 41 4d 45 0d 20 20 | 20 20 20 70 65 72 6c 20 |.NAME. | perl |
|00000090| 2d 20 50 72 61 63 74 69 | 63 61 6c 20 45 78 74 72 |- Practi|cal Extr|
|000000a0| 61 63 74 69 6f 6e 20 61 | 6e 64 20 52 65 70 6f 72 |action a|nd Repor|
|000000b0| 74 20 4c 61 6e 67 75 61 | 67 65 0d 0d 53 59 4e 4f |t Langua|ge..SYNO|
|000000c0| 50 53 49 53 0d 20 20 20 | 20 20 70 65 72 6c 20 5b |PSIS. | perl [|
|000000d0| 6f 70 74 69 6f 6e 73 5d | 20 66 69 6c 65 6e 61 6d |options]| filenam|
|000000e0| 65 20 61 72 67 73 0d 0d | 44 45 53 43 52 49 50 54 |e args..|DESCRIPT|
|000000f0| 49 4f 4e 0d 20 20 20 20 | 20 50 65 72 6c 20 69 73 |ION. | Perl is|
|00000100| 20 61 6e 20 69 6e 74 65 | 72 70 72 65 74 65 64 20 | an inte|rpreted |
|00000110| 6c 61 6e 67 75 61 67 65 | 20 6f 70 74 69 6d 69 7a |language| optimiz|
|00000120| 65 64 20 66 6f 72 20 73 | 63 61 6e 6e 69 6e 67 20 |ed for s|canning |
|00000130| 61 72 62 69 2d 0d 20 20 | 20 20 20 74 72 61 72 79 |arbi-. | trary|
|00000140| 20 20 74 65 78 74 20 20 | 66 69 6c 65 73 2c 20 20 | text |files, |
|00000150| 65 78 74 72 61 63 74 69 | 6e 67 20 20 69 6e 66 6f |extracti|ng info|
|00000160| 72 6d 61 74 69 6f 6e 20 | 66 72 6f 6d 20 74 68 6f |rmation |from tho|
|00000170| 73 65 20 74 65 78 74 0d | 20 20 20 20 20 66 69 6c |se text.| fil|
|00000180| 65 73 2c 20 61 6e 64 20 | 70 72 69 6e 74 69 6e 67 |es, and |printing|
|00000190| 20 72 65 70 6f 72 74 73 | 20 62 61 73 65 64 20 6f | reports| based o|
|000001a0| 6e 20 74 68 61 74 20 69 | 6e 66 6f 72 6d 61 74 69 |n that i|nformati|
|000001b0| 6f 6e 2e 20 20 49 74 27 | 73 0d 20 20 20 20 20 61 |on. It'|s. a|
|000001c0| 6c 73 6f 20 20 61 20 67 | 6f 6f 64 20 6c 61 6e 67 |lso a g|ood lang|
|000001d0| 75 61 67 65 20 66 6f 72 | 20 6d 61 6e 79 20 73 79 |uage for| many sy|
|000001e0| 73 74 65 6d 20 6d 61 6e | 61 67 65 6d 65 6e 74 20 |stem man|agement |
|000001f0| 74 61 73 6b 73 2e 20 20 | 54 68 65 0d 20 20 20 20 |tasks. |The. |
|00000200| 20 6c 61 6e 67 75 61 67 | 65 20 69 73 20 69 6e 74 | languag|e is int|
|00000210| 65 6e 64 65 64 20 74 6f | 20 62 65 20 70 72 61 63 |ended to| be prac|
|00000220| 74 69 63 61 6c 20 20 28 | 65 61 73 79 20 20 74 6f |tical (|easy to|
|00000230| 20 20 75 73 65 2c 20 20 | 65 66 66 69 2d 0d 20 20 | use, |effi-. |
|00000240| 20 20 20 63 69 65 6e 74 | 2c 20 20 63 6f 6d 70 6c | cient|, compl|
|00000250| 65 74 65 29 20 20 72 61 | 74 68 65 72 20 20 74 68 |ete) ra|ther th|
|00000260| 61 6e 20 20 62 65 61 75 | 74 69 66 75 6c 20 20 28 |an beau|tiful (|
|00000270| 74 69 6e 79 2c 20 20 65 | 6c 65 67 61 6e 74 2c 0d |tiny, e|legant,.|
|00000280| 20 20 20 20 20 6d 69 6e | 69 6d 61 6c 29 2e 20 20 | min|imal). |
|00000290| 49 74 20 63 6f 6d 62 69 | 6e 65 73 20 28 69 6e 20 |It combi|nes (in |
|000002a0| 20 74 68 65 20 20 61 75 | 74 68 6f 72 27 73 20 20 | the au|thor's |
|000002b0| 6f 70 69 6e 69 6f 6e 2c | 20 20 61 6e 79 77 61 79 |opinion,| anyway|
|000002c0| 29 0d 20 20 20 20 20 73 | 6f 6d 65 20 20 6f 66 20 |). s|ome of |
|000002d0| 74 68 65 20 62 65 73 74 | 20 66 65 61 74 75 72 65 |the best| feature|
|000002e0| 73 20 6f 66 20 43 2c 20 | 73 65 64 2c 20 61 77 6b |s of C, |sed, awk|
|000002f0| 2c 20 61 6e 64 20 73 68 | 2c 20 73 6f 20 70 65 6f |, and sh|, so peo|
|00000300| 70 6c 65 0d 20 20 20 20 | 20 66 61 6d 69 6c 69 61 |ple. | familia|
|00000310| 72 20 77 69 74 68 20 74 | 68 6f 73 65 20 6c 61 6e |r with t|hose lan|
|00000320| 67 75 61 67 65 73 20 73 | 68 6f 75 6c 64 20 68 61 |guages s|hould ha|
|00000330| 76 65 20 6c 69 74 74 6c | 65 20 20 64 69 66 66 69 |ve littl|e diffi|
|00000340| 63 75 6c 74 79 0d 20 20 | 20 20 20 77 69 74 68 20 |culty. | with |
|00000350| 20 69 74 2e 20 20 28 4c | 61 6e 67 75 61 67 65 20 | it. (L|anguage |
|00000360| 68 69 73 74 6f 72 69 61 | 6e 73 20 77 69 6c 6c 20 |historia|ns will |
|00000370| 61 6c 73 6f 20 6e 6f 74 | 65 20 73 6f 6d 65 20 76 |also not|e some v|
|00000380| 65 73 74 69 67 65 73 0d | 20 20 20 20 20 6f 66 20 |estiges.| of |
|00000390| 63 73 68 2c 20 50 61 73 | 63 61 6c 2c 20 20 61 6e |csh, Pas|cal, an|
|000003a0| 64 20 20 65 76 65 6e 20 | 20 42 41 53 49 43 2d 50 |d even | BASIC-P|
|000003b0| 4c 55 53 2e 29 20 20 45 | 78 70 72 65 73 73 69 6f |LUS.) E|xpressio|
|000003c0| 6e 20 20 73 79 6e 74 61 | 78 0d 20 20 20 20 20 63 |n synta|x. c|
|000003d0| 6f 72 72 65 73 70 6f 6e | 64 73 20 20 71 75 69 74 |orrespon|ds quit|
|000003e0| 65 20 20 63 6c 6f 73 65 | 6c 79 20 20 74 6f 20 43 |e close|ly to C|
|000003f0| 20 65 78 70 72 65 73 73 | 69 6f 6e 20 73 79 6e 74 | express|ion synt|
|00000400| 61 78 2e 20 20 55 6e 6c | 69 6b 65 0d 20 20 20 20 |ax. Unl|ike. |
|00000410| 20 6d 6f 73 74 20 55 6e | 69 78 20 75 74 69 6c 69 | most Un|ix utili|
|00000420| 74 69 65 73 2c 20 70 65 | 72 6c 20 64 6f 65 73 20 |ties, pe|rl does |
|00000430| 20 6e 6f 74 20 20 61 72 | 62 69 74 72 61 72 69 6c | not ar|bitraril|
|00000440| 79 20 20 6c 69 6d 69 74 | 20 20 74 68 65 0d 20 20 |y limit| the. |
|00000450| 20 20 20 73 69 7a 65 20 | 20 6f 66 20 79 6f 75 72 | size | of your|
|00000460| 20 64 61 74 61 2d 2d 69 | 66 20 79 6f 75 27 76 65 | data--i|f you've|
|00000470| 20 67 6f 74 20 74 68 65 | 20 6d 65 6d 6f 72 79 2c | got the| memory,|
|00000480| 20 70 65 72 6c 20 63 61 | 6e 20 73 6c 75 72 70 0d | perl ca|n slurp.|
|00000490| 20 20 20 20 20 69 6e 20 | 79 6f 75 72 20 77 68 6f | in |your who|
|000004a0| 6c 65 20 66 69 6c 65 20 | 61 73 20 61 20 20 73 69 |le file |as a si|
|000004b0| 6e 67 6c 65 20 20 73 74 | 72 69 6e 67 2e 20 20 20 |ngle st|ring. |
|000004c0| 52 65 63 75 72 73 69 6f | 6e 20 20 69 73 20 20 6f |Recursio|n is o|
|000004d0| 66 0d 20 20 20 20 20 75 | 6e 6c 69 6d 69 74 65 64 |f. u|nlimited|
|000004e0| 20 20 64 65 70 74 68 2e | 20 20 20 41 6e 64 20 20 | depth.| And |
|000004f0| 74 68 65 20 68 61 73 68 | 20 74 61 62 6c 65 73 20 |the hash| tables |
|00000500| 75 73 65 64 20 62 79 20 | 61 73 73 6f 63 69 61 74 |used by |associat|
|00000510| 69 76 65 0d 20 20 20 20 | 20 61 72 72 61 79 73 20 |ive. | arrays |
|00000520| 67 72 6f 77 20 61 73 20 | 6e 65 63 65 73 73 61 72 |grow as |necessar|
|00000530| 79 20 74 6f 20 20 70 72 | 65 76 65 6e 74 20 20 64 |y to pr|event d|
|00000540| 65 67 72 61 64 65 64 20 | 20 70 65 72 66 6f 72 6d |egraded | perform|
|00000550| 61 6e 63 65 2e 0d 20 20 | 20 20 20 50 65 72 6c 20 |ance.. | Perl |
|00000560| 20 75 73 65 73 20 73 6f | 70 68 69 73 74 69 63 61 | uses so|phistica|
|00000570| 74 65 64 20 70 61 74 74 | 65 72 6e 20 6d 61 74 63 |ted patt|ern matc|
|00000580| 68 69 6e 67 20 74 65 63 | 68 6e 69 71 75 65 73 20 |hing tec|hniques |
|00000590| 74 6f 20 73 63 61 6e 0d | 20 20 20 20 20 6c 61 72 |to scan.| lar|
|000005a0| 67 65 20 61 6d 6f 75 6e | 74 73 20 6f 66 20 64 61 |ge amoun|ts of da|
|000005b0| 74 61 20 76 65 72 79 20 | 71 75 69 63 6b 6c 79 2e |ta very |quickly.|
|000005c0| 20 20 41 6c 74 68 6f 75 | 67 68 20 6f 70 74 69 6d | Althou|gh optim|
|000005d0| 69 7a 65 64 20 20 66 6f | 72 0d 20 20 20 20 20 73 |ized fo|r. s|
|000005e0| 63 61 6e 6e 69 6e 67 20 | 20 74 65 78 74 2c 20 70 |canning | text, p|
|000005f0| 65 72 6c 20 63 61 6e 20 | 61 6c 73 6f 20 64 65 61 |erl can |also dea|
|00000600| 6c 20 77 69 74 68 20 62 | 69 6e 61 72 79 20 64 61 |l with b|inary da|
|00000610| 74 61 2c 20 61 6e 64 20 | 63 61 6e 0d 20 20 20 20 |ta, and |can. |
|00000620| 20 6d 61 6b 65 20 64 62 | 6d 20 66 69 6c 65 73 20 | make db|m files |
|00000630| 6c 6f 6f 6b 20 6c 69 6b | 65 20 61 73 73 6f 63 69 |look lik|e associ|
|00000640| 61 74 69 76 65 20 61 72 | 72 61 79 73 20 20 28 77 |ative ar|rays (w|
|00000650| 68 65 72 65 20 20 64 62 | 6d 20 20 69 73 0d 20 20 |here db|m is. |
|00000660| 20 20 20 61 76 61 69 6c | 61 62 6c 65 29 2e 20 20 | avail|able). |
|00000670| 20 53 65 74 75 69 64 20 | 20 70 65 72 6c 20 73 63 | Setuid | perl sc|
|00000680| 72 69 70 74 73 20 61 72 | 65 20 73 61 66 65 72 20 |ripts ar|e safer |
|00000690| 74 68 61 6e 20 43 20 70 | 72 6f 67 72 61 6d 73 0d |than C p|rograms.|
|000006a0| 20 20 20 20 20 74 68 72 | 6f 75 67 68 20 61 20 64 | thr|ough a d|
|000006b0| 61 74 61 66 6c 6f 77 20 | 74 72 61 63 69 6e 67 20 |ataflow |tracing |
|000006c0| 20 6d 65 63 68 61 6e 69 | 73 6d 20 20 77 68 69 63 | mechani|sm whic|
|000006d0| 68 20 20 70 72 65 76 65 | 6e 74 73 20 20 6d 61 6e |h preve|nts man|
|000006e0| 79 0d 20 20 20 20 20 73 | 74 75 70 69 64 20 20 73 |y. s|tupid s|
|000006f0| 65 63 75 72 69 74 79 20 | 20 68 6f 6c 65 73 2e 20 |ecurity | holes. |
|00000700| 20 20 49 66 20 20 79 6f | 75 20 68 61 76 65 20 61 | If yo|u have a|
|00000710| 20 70 72 6f 62 6c 65 6d | 20 74 68 61 74 20 77 6f | problem| that wo|
|00000720| 75 6c 64 0d 20 20 20 20 | 20 6f 72 64 69 6e 61 72 |uld. | ordinar|
|00000730| 69 6c 79 20 75 73 65 20 | 73 65 64 20 6f 72 20 61 |ily use |sed or a|
|00000740| 77 6b 20 6f 72 20 73 68 | 2c 20 62 75 74 20 69 74 |wk or sh|, but it|
|00000750| 20 65 78 63 65 65 64 73 | 20 74 68 65 69 72 20 20 | exceeds| their |
|00000760| 63 61 70 61 2d 0d 20 20 | 20 20 20 62 69 6c 69 74 |capa-. | bilit|
|00000770| 69 65 73 20 20 6f 72 20 | 6d 75 73 74 20 72 75 6e |ies or |must run|
|00000780| 20 61 20 6c 69 74 74 6c | 65 20 66 61 73 74 65 72 | a littl|e faster|
|00000790| 2c 20 61 6e 64 20 79 6f | 75 20 64 6f 6e 27 74 20 |, and yo|u don't |
|000007a0| 77 61 6e 74 20 74 6f 0d | 20 20 20 20 20 77 72 69 |want to.| wri|
|000007b0| 74 65 20 74 68 65 20 73 | 69 6c 6c 79 20 74 68 69 |te the s|illy thi|
|000007c0| 6e 67 20 69 6e 20 43 2c | 20 74 68 65 6e 20 70 65 |ng in C,| then pe|
|000007d0| 72 6c 20 6d 61 79 20 62 | 65 20 66 6f 72 20 79 6f |rl may b|e for yo|
|000007e0| 75 2e 20 20 54 68 65 72 | 65 0d 20 20 20 20 20 61 |u. Ther|e. a|
|000007f0| 72 65 20 20 61 6c 73 6f | 20 20 74 72 61 6e 73 6c |re also| transl|
|00000800| 61 74 6f 72 73 20 74 6f | 20 74 75 72 6e 20 79 6f |ators to| turn yo|
|00000810| 75 72 20 73 65 64 20 61 | 6e 64 20 61 77 6b 20 73 |ur sed a|nd awk s|
|00000820| 63 72 69 70 74 73 20 69 | 6e 74 6f 0d 20 20 20 20 |cripts i|nto. |
|00000830| 20 70 65 72 6c 20 73 63 | 72 69 70 74 73 2e 20 20 | perl sc|ripts. |
|00000840| 4f 4b 2c 20 65 6e 6f 75 | 67 68 20 68 79 70 65 2e |OK, enou|gh hype.|
|00000850| 0d 0d 20 20 20 20 20 55 | 70 6f 6e 20 73 74 61 72 |.. U|pon star|
|00000860| 74 75 70 2c 20 70 65 72 | 6c 20 6c 6f 6f 6b 73 20 |tup, per|l looks |
|00000870| 66 6f 72 20 79 6f 75 72 | 20 73 63 72 69 70 74 20 |for your| script |
|00000880| 69 6e 20 6f 6e 65 20 6f | 66 20 74 68 65 20 20 66 |in one o|f the f|
|00000890| 6f 6c 2d 0d 20 20 20 20 | 20 6c 6f 77 69 6e 67 20 |ol-. | lowing |
|000008a0| 70 6c 61 63 65 73 3a 0d | 0d 20 20 20 20 20 31 2e |places:.|. 1.|
|000008b0| 20 20 53 70 65 63 69 66 | 69 65 64 20 6c 69 6e 65 | Specif|ied line|
|000008c0| 20 62 79 20 6c 69 6e 65 | 20 76 69 61 20 2d 65 20 | by line| via -e |
|000008d0| 73 77 69 74 63 68 65 73 | 20 20 6f 6e 20 20 74 68 |switches| on th|
|000008e0| 65 20 20 63 6f 6d 6d 61 | 6e 64 0d 20 20 20 20 20 |e comma|nd. |
|000008f0| 20 20 20 20 6c 69 6e 65 | 2e 0d 0d 20 20 20 20 20 | line|... |
|00000900| 32 2e 20 20 43 6f 6e 74 | 61 69 6e 65 64 20 69 6e |2. Cont|ained in|
|00000910| 20 74 68 65 20 66 69 6c | 65 20 73 70 65 63 69 66 | the fil|e specif|
|00000920| 69 65 64 20 62 79 20 74 | 68 65 20 66 69 72 73 74 |ied by t|he first|
|00000930| 20 66 69 6c 65 6e 61 6d | 65 20 6f 6e 0d 20 20 20 | filenam|e on. |
|00000940| 20 20 20 20 20 20 74 68 | 65 20 20 63 6f 6d 6d 61 | th|e comma|
|00000950| 6e 64 20 6c 69 6e 65 2e | 20 20 28 4e 6f 74 65 20 |nd line.| (Note |
|00000960| 74 68 61 74 20 73 79 73 | 74 65 6d 73 20 73 75 70 |that sys|tems sup|
|00000970| 70 6f 72 74 69 6e 67 20 | 74 68 65 20 23 21 0d 20 |porting |the #!. |
|00000980| 20 20 20 20 20 20 20 20 | 6e 6f 74 61 74 69 6f 6e | |notation|
|00000990| 20 69 6e 76 6f 6b 65 20 | 69 6e 74 65 72 70 72 65 | invoke |interpre|
|000009a0| 74 65 72 73 20 74 68 69 | 73 20 77 61 79 2e 29 0d |ters thi|s way.).|
|000009b0| 0d 20 20 20 20 20 33 2e | 20 20 50 61 73 73 65 64 |. 3.| Passed|
|000009c0| 20 69 6e 20 69 6d 70 6c | 69 63 69 74 6c 79 20 20 | in impl|icitly |
|000009d0| 76 69 61 20 20 73 74 61 | 6e 64 61 72 64 20 20 69 |via sta|ndard i|
|000009e0| 6e 70 75 74 2e 20 20 20 | 54 68 69 73 20 20 6f 6e |nput. |This on|
|000009f0| 6c 79 0d 20 20 20 20 20 | 20 20 20 20 77 6f 72 6b |ly. | work|
|00000a00| 73 20 20 69 66 20 74 68 | 65 72 65 20 61 72 65 20 |s if th|ere are |
|00000a10| 6e 6f 20 66 69 6c 65 6e | 61 6d 65 20 61 72 67 75 |no filen|ame argu|
|00000a20| 6d 65 6e 74 73 2d 2d 74 | 6f 20 70 61 73 73 20 61 |ments--t|o pass a|
|00000a30| 72 67 75 2d 0d 20 20 20 | 20 20 20 20 20 20 6d 65 |rgu-. | me|
|00000a40| 6e 74 73 20 74 6f 20 61 | 20 73 74 64 69 6e 20 73 |nts to a| stdin s|
|00000a50| 63 72 69 70 74 20 79 6f | 75 20 6d 75 73 74 20 65 |cript yo|u must e|
|00000a60| 78 70 6c 69 63 69 74 6c | 79 20 73 70 65 63 69 66 |xplicitl|y specif|
|00000a70| 79 20 61 20 20 2d 0d 20 | 20 20 20 20 20 20 20 20 |y a -. | |
|00000a80| 66 6f 72 20 74 68 65 20 | 73 63 72 69 70 74 20 6e |for the |script n|
|00000a90| 61 6d 65 2e 0d 0d 20 20 | 20 20 20 41 66 74 65 72 |ame... | After|
|00000aa0| 20 6c 6f 63 61 74 69 6e | 67 20 79 6f 75 72 20 73 | locatin|g your s|
|00000ab0| 63 72 69 70 74 2c 20 70 | 65 72 6c 20 63 6f 6d 70 |cript, p|erl comp|
|00000ac0| 69 6c 65 73 20 69 74 20 | 74 6f 20 61 6e 20 20 69 |iles it |to an i|
|00000ad0| 6e 74 65 72 6e 61 6c 0d | 20 20 20 20 20 66 6f 72 |nternal.| for|
|00000ae0| 6d 2e 20 20 20 49 66 20 | 20 74 68 65 20 20 73 63 |m. If | the sc|
|00000af0| 72 69 70 74 20 69 73 20 | 73 79 6e 74 61 63 74 69 |ript is |syntacti|
|00000b00| 63 61 6c 6c 79 20 63 6f | 72 72 65 63 74 2c 20 69 |cally co|rrect, i|
|00000b10| 74 20 69 73 20 65 78 65 | 2d 0d 20 20 20 20 20 63 |t is exe|-. c|
|00000b20| 75 74 65 64 2e 0d 0d 20 | 20 20 20 20 4f 70 74 69 |uted... | Opti|
|00000b30| 6f 6e 73 0d 0d 20 20 20 | 20 20 4e 6f 74 65 3a 20 |ons.. | Note: |
|00000b40| 6f 6e 20 66 69 72 73 74 | 20 72 65 61 64 69 6e 67 |on first| reading|
|00000b50| 20 74 68 69 73 20 73 65 | 63 74 69 6f 6e 20 6d 61 | this se|ction ma|
|00000b60| 79 20 6e 6f 74 20 6d 61 | 6b 65 20 6d 75 63 68 20 |y not ma|ke much |
|00000b70| 20 73 65 6e 73 65 0d 20 | 20 20 20 20 74 6f 20 79 | sense. | to y|
|00000b80| 6f 75 2e 20 20 49 74 27 | 73 20 68 65 72 65 20 61 |ou. It'|s here a|
|00000b90| 74 20 74 68 65 20 66 72 | 6f 6e 74 20 66 6f 72 20 |t the fr|ont for |
|00000ba0| 65 61 73 79 20 72 65 66 | 65 72 65 6e 63 65 2e 0d |easy ref|erence..|
|00000bb0| 0d 20 20 20 20 20 41 20 | 73 69 6e 67 6c 65 2d 63 |. A |single-c|
|00000bc0| 68 61 72 61 63 74 65 72 | 20 6f 70 74 69 6f 6e 20 |haracter| option |
|00000bd0| 6d 61 79 20 62 65 20 63 | 6f 6d 62 69 6e 65 64 20 |may be c|ombined |
|00000be0| 77 69 74 68 20 74 68 65 | 20 66 6f 6c 6c 6f 77 69 |with the| followi|
|00000bf0| 6e 67 0d 20 20 20 20 20 | 6f 70 74 69 6f 6e 2c 20 |ng. |option, |
|00000c00| 69 66 20 61 6e 79 2e 20 | 20 54 68 69 73 20 69 73 |if any. | This is|
|00000c10| 20 70 61 72 74 69 63 75 | 6c 61 72 6c 79 20 75 73 | particu|larly us|
|00000c20| 65 66 75 6c 20 77 68 65 | 6e 20 69 6e 76 6f 6b 69 |eful whe|n invoki|
|00000c30| 6e 67 20 61 0d 20 20 20 | 20 20 73 63 72 69 70 74 |ng a. | script|
|00000c40| 20 75 73 69 6e 67 20 74 | 68 65 20 23 21 20 63 6f | using t|he #! co|
|00000c50| 6e 73 74 72 75 63 74 20 | 77 68 69 63 68 20 6f 6e |nstruct |which on|
|00000c60| 6c 79 20 20 61 6c 6c 6f | 77 73 20 20 6f 6e 65 20 |ly allo|ws one |
|00000c70| 20 61 72 67 75 2d 0d 20 | 20 20 20 20 6d 65 6e 74 | argu-. | ment|
|00000c80| 2e 20 20 45 78 61 6d 70 | 6c 65 3a 0d 0d 20 20 20 |. Examp|le:.. |
|00000c90| 20 20 20 20 20 20 20 23 | 21 2f 75 73 72 2f 62 69 | #|!/usr/bi|
|00000ca0| 6e 2f 70 65 72 6c 20 2d | 73 70 69 2e 62 61 6b 20 |n/perl -|spi.bak |
|00000cb0| 23 20 73 61 6d 65 20 61 | 73 20 2d 73 20 2d 70 20 |# same a|s -s -p |
|00000cc0| 2d 69 2e 62 61 6b 0d 20 | 20 20 20 20 20 20 20 20 |-i.bak. | |
|00000cd0| 20 2e 2e 2e 0d 0d 20 20 | 20 20 20 4f 70 74 69 6f | ..... | Optio|
|00000ce0| 6e 73 20 69 6e 63 6c 75 | 64 65 3a 0d 0d 20 20 20 |ns inclu|de:.. |
|00000cf0| 20 20 2d 30 64 69 67 69 | 74 73 0d 20 20 20 20 20 | -0digi|ts. |
|00000d00| 20 20 20 20 20 73 70 65 | 63 69 66 69 65 73 20 74 | spe|cifies t|
|00000d10| 68 65 20 72 65 63 6f 72 | 64 20 73 65 70 61 72 61 |he recor|d separa|
|00000d20| 74 6f 72 20 28 24 2f 29 | 20 61 73 20 61 6e 20 6f |tor ($/)| as an o|
|00000d30| 63 74 61 6c 20 6e 75 6d | 62 65 72 2e 0d 20 20 20 |ctal num|ber.. |
|00000d40| 20 20 20 20 20 20 20 49 | 66 20 20 74 68 65 72 65 | I|f there|
|00000d50| 20 20 61 72 65 20 20 6e | 6f 20 20 64 69 67 69 74 | are n|o digit|
|00000d60| 73 2c 20 20 74 68 65 20 | 20 6e 75 6c 6c 20 63 68 |s, the | null ch|
|00000d70| 61 72 61 63 74 65 72 20 | 69 73 20 74 68 65 0d 20 |aracter |is the. |
|00000d80| 20 20 20 20 20 20 20 20 | 20 73 65 70 61 72 61 74 | | separat|
|00000d90| 6f 72 2e 20 20 4f 74 68 | 65 72 20 73 77 69 74 63 |or. Oth|er switc|
|00000da0| 68 65 73 20 6d 61 79 20 | 70 72 65 63 65 64 65 20 |hes may |precede |
|00000db0| 20 6f 72 20 20 66 6f 6c | 6c 6f 77 20 20 74 68 65 | or fol|low the|
|00000dc0| 0d 20 20 20 20 20 20 20 | 20 20 20 64 69 67 69 74 |. | digit|
|00000dd0| 73 2e 20 20 20 46 6f 72 | 20 20 65 78 61 6d 70 6c |s. For| exampl|
|00000de0| 65 2c 20 20 69 66 20 20 | 79 6f 75 20 68 61 76 65 |e, if |you have|
|00000df0| 20 61 20 76 65 72 73 69 | 6f 6e 20 6f 66 20 66 69 | a versi|on of fi|
|00000e00| 6e 64 0d 20 20 20 20 20 | 20 20 20 20 20 77 68 69 |nd. | whi|
|00000e10| 63 68 20 63 61 6e 20 70 | 72 69 6e 74 20 66 69 6c |ch can p|rint fil|
|00000e20| 65 6e 61 6d 65 73 20 74 | 65 72 6d 69 6e 61 74 65 |enames t|erminate|
|00000e30| 64 20 62 79 20 74 68 65 | 20 6e 75 6c 6c 20 20 63 |d by the| null c|
|00000e40| 68 61 72 2d 0d 20 20 20 | 20 20 20 20 20 20 20 61 |har-. | a|
|00000e50| 63 74 65 72 2c 20 79 6f | 75 20 63 61 6e 20 73 61 |cter, yo|u can sa|
|00000e60| 79 20 74 68 69 73 3a 0d | 0d 20 20 20 20 20 20 20 |y this:.|. |
|00000e70| 20 20 20 20 20 20 20 66 | 69 6e 64 20 2e 20 2d 6e | f|ind . -n|
|00000e80| 61 6d 65 20 27 2a 2e 62 | 61 6b 27 20 2d 70 72 69 |ame '*.b|ak' -pri|
|00000e90| 6e 74 30 20 7c 20 70 65 | 72 6c 20 2d 6e 30 65 20 |nt0 | pe|rl -n0e |
|00000ea0| 75 6e 6c 69 6e 6b 0d 0d | 20 20 20 20 20 20 20 20 |unlink..| |
|00000eb0| 20 20 54 68 65 20 73 70 | 65 63 69 61 6c 20 76 61 | The sp|ecial va|
|00000ec0| 6c 75 65 20 30 30 20 77 | 69 6c 6c 20 63 61 75 73 |lue 00 w|ill caus|
|00000ed0| 65 20 50 65 72 6c 20 74 | 6f 20 73 6c 75 72 70 20 |e Perl t|o slurp |
|00000ee0| 66 69 6c 65 73 20 20 69 | 6e 0d 20 20 20 20 20 20 |files i|n. |
|00000ef0| 20 20 20 20 70 61 72 61 | 67 72 61 70 68 20 20 6d | para|graph m|
|00000f00| 6f 64 65 2e 20 20 20 54 | 68 65 20 20 76 61 6c 75 |ode. T|he valu|
|00000f10| 65 20 20 30 37 37 37 20 | 20 77 69 6c 6c 20 63 61 |e 0777 | will ca|
|00000f20| 75 73 65 20 50 65 72 6c | 20 74 6f 0d 20 20 20 20 |use Perl| to. |
|00000f30| 20 20 20 20 20 20 73 6c | 75 72 70 20 66 69 6c 65 | sl|urp file|
|00000f40| 73 20 77 68 6f 6c 65 20 | 73 69 6e 63 65 20 74 68 |s whole |since th|
|00000f50| 65 72 65 20 20 69 73 20 | 20 6e 6f 20 20 6c 65 67 |ere is | no leg|
|00000f60| 61 6c 20 20 63 68 61 72 | 61 63 74 65 72 0d 20 20 |al char|acter. |
|00000f70| 20 20 20 20 20 20 20 20 | 77 69 74 68 20 74 68 61 | |with tha|
|00000f80| 74 20 76 61 6c 75 65 2e | 0d 0d 20 20 20 20 20 2d |t value.|.. -|
|00000f90| 61 20 20 20 74 75 72 6e | 73 20 6f 6e 20 61 75 74 |a turn|s on aut|
|00000fa0| 6f 73 70 6c 69 74 20 6d | 6f 64 65 20 77 68 65 6e |osplit m|ode when|
|00000fb0| 20 75 73 65 64 20 77 69 | 74 68 20 61 20 2d 6e 20 | used wi|th a -n |
|00000fc0| 6f 72 20 2d 70 2e 20 20 | 20 41 6e 0d 20 20 20 20 |or -p. | An. |
|00000fd0| 20 20 20 20 20 20 69 6d | 70 6c 69 63 69 74 20 20 | im|plicit |
|00000fe0| 73 70 6c 69 74 20 20 63 | 6f 6d 6d 61 6e 64 20 74 |split c|ommand t|
|00000ff0| 6f 20 74 68 65 20 40 46 | 20 61 72 72 61 79 20 69 |o the @F| array i|
|00001000| 73 20 64 6f 6e 65 20 61 | 73 20 74 68 65 0d 20 20 |s done a|s the. |
|00001010| 20 20 20 20 20 20 20 20 | 66 69 72 73 74 20 74 68 | |first th|
|00001020| 69 6e 67 20 69 6e 73 69 | 64 65 20 74 68 65 20 69 |ing insi|de the i|
|00001030| 6d 70 6c 69 63 69 74 20 | 77 68 69 6c 65 20 6c 6f |mplicit |while lo|
|00001040| 6f 70 20 70 72 6f 64 75 | 63 65 64 20 20 62 79 0d |op produ|ced by.|
|00001050| 20 20 20 20 20 20 20 20 | 20 20 74 68 65 20 2d 6e | | the -n|
|00001060| 20 6f 72 20 2d 70 2e 0d | 0d 20 20 20 20 20 20 20 | or -p..|. |
|00001070| 20 20 20 20 20 20 20 20 | 70 65 72 6c 20 2d 61 6e | |perl -an|
|00001080| 65 20 27 70 72 69 6e 74 | 20 70 6f 70 28 40 46 29 |e 'print| pop(@F)|
|00001090| 2c 20 22 5c 6e 22 3b 27 | 0d 0d 20 20 20 20 20 20 |, "\n";'|.. |
|000010a0| 20 20 20 20 69 73 20 65 | 71 75 69 76 61 6c 65 6e | is e|quivalen|
|000010b0| 74 20 74 6f 0d 0d 20 20 | 20 20 20 20 20 20 20 20 |t to.. | |
|000010c0| 20 20 20 20 20 77 68 69 | 6c 65 20 28 3c 3e 29 20 | whi|le (<>) |
|000010d0| 7b 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |{. | |
|000010e0| 20 20 20 20 20 20 40 46 | 20 3d 20 73 70 6c 69 74 | @F| = split|
|000010f0| 28 27 20 27 29 3b 0d 20 | 20 20 20 20 20 20 20 20 |(' ');. | |
|00001100| 20 20 20 20 20 20 20 20 | 20 20 20 70 72 69 6e 74 | | print|
|00001110| 20 70 6f 70 28 40 46 29 | 2c 20 22 5c 6e 22 3b 0d | pop(@F)|, "\n";.|
|00001120| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 7d | | }|
|00001130| 0d 0d 20 20 20 20 20 2d | 63 20 20 20 63 61 75 73 |.. -|c caus|
|00001140| 65 73 20 70 65 72 6c 20 | 74 6f 20 63 68 65 63 6b |es perl |to check|
|00001150| 20 74 68 65 20 73 79 6e | 74 61 78 20 6f 66 20 74 | the syn|tax of t|
|00001160| 68 65 20 73 63 72 69 70 | 74 20 61 6e 64 20 20 74 |he scrip|t and t|
|00001170| 68 65 6e 0d 20 20 20 20 | 20 20 20 20 20 20 65 78 |hen. | ex|
|00001180| 69 74 20 77 69 74 68 6f | 75 74 20 65 78 65 63 75 |it witho|ut execu|
|00001190| 74 69 6e 67 20 69 74 2e | 0d 0d 20 20 20 20 20 2d |ting it.|.. -|
|000011a0| 64 20 20 20 72 75 6e 73 | 20 74 68 65 20 73 63 72 |d runs| the scr|
|000011b0| 69 70 74 20 75 6e 64 65 | 72 20 74 68 65 20 70 65 |ipt unde|r the pe|
|000011c0| 72 6c 20 64 65 62 75 67 | 67 65 72 2e 20 20 53 65 |rl debug|ger. Se|
|000011d0| 65 20 74 68 65 20 20 73 | 65 63 2d 0d 20 20 20 20 |e the s|ec-. |
|000011e0| 20 20 20 20 20 20 74 69 | 6f 6e 20 6f 6e 20 44 65 | ti|on on De|
|000011f0| 62 75 67 67 69 6e 67 2e | 0d 0d 20 20 20 20 20 2d |bugging.|.. -|
|00001200| 44 6e 75 6d 62 65 72 0d | 20 20 20 20 20 20 20 20 |Dnumber.| |
|00001210| 20 20 73 65 74 73 20 64 | 65 62 75 67 67 69 6e 67 | sets d|ebugging|
|00001220| 20 66 6c 61 67 73 2e 20 | 20 54 6f 20 77 61 74 63 | flags. | To watc|
|00001230| 68 20 68 6f 77 20 20 69 | 74 20 20 65 78 65 63 75 |h how i|t execu|
|00001240| 74 65 73 20 20 79 6f 75 | 72 0d 20 20 20 20 20 20 |tes you|r. |
|00001250| 20 20 20 20 73 63 72 69 | 70 74 2c 20 20 75 73 65 | scri|pt, use|
|00001260| 20 20 2d 44 31 34 2e 20 | 20 20 28 54 68 69 73 20 | -D14. | (This |
|00001270| 20 6f 6e 6c 79 20 77 6f | 72 6b 73 20 69 66 20 64 | only wo|rks if d|
|00001280| 65 62 75 67 67 69 6e 67 | 20 69 73 0d 20 20 20 20 |ebugging| is. |
|00001290| 20 20 20 20 20 20 63 6f | 6d 70 69 6c 65 64 20 69 | co|mpiled i|
|000012a0| 6e 74 6f 20 79 6f 75 72 | 20 70 65 72 6c 2e 29 20 |nto your| perl.) |
|000012b0| 41 6e 6f 74 68 65 72 20 | 6e 69 63 65 20 76 61 6c |Another |nice val|
|000012c0| 75 65 20 69 73 20 2d 44 | 31 30 32 34 2c 0d 20 20 |ue is -D|1024,. |
|000012d0| 20 20 20 20 20 20 20 20 | 77 68 69 63 68 20 20 6c | |which l|
|000012e0| 69 73 74 73 20 20 79 6f | 75 72 20 20 63 6f 6d 70 |ists yo|ur comp|
|000012f0| 69 6c 65 64 20 20 73 79 | 6e 74 61 78 20 20 74 72 |iled sy|ntax tr|
|00001300| 65 65 2e 20 20 20 41 6e | 64 20 2d 44 35 31 32 0d |ee. An|d -D512.|
|00001310| 20 20 20 20 20 20 20 20 | 20 20 64 69 73 70 6c 61 | | displa|
|00001320| 79 73 20 63 6f 6d 70 69 | 6c 65 64 20 72 65 67 75 |ys compi|led regu|
|00001330| 6c 61 72 20 65 78 70 72 | 65 73 73 69 6f 6e 73 2e |lar expr|essions.|
|00001340| 0d 0d 20 20 20 20 20 2d | 65 20 63 6f 6d 6d 61 6e |.. -|e comman|
|00001350| 64 6c 69 6e 65 0d 20 20 | 20 20 20 20 20 20 20 20 |dline. | |
|00001360| 6d 61 79 20 62 65 20 75 | 73 65 64 20 74 6f 20 65 |may be u|sed to e|
|00001370| 6e 74 65 72 20 6f 6e 65 | 20 6c 69 6e 65 20 6f 66 |nter one| line of|
|00001380| 20 73 63 72 69 70 74 2e | 20 20 20 4d 75 6c 74 69 | script.| Multi|
|00001390| 70 6c 65 20 20 2d 65 0d | 20 20 20 20 20 20 20 20 |ple -e.| |
|000013a0| 20 20 63 6f 6d 6d 61 6e | 64 73 20 20 6d 61 79 20 | comman|ds may |
|000013b0| 62 65 20 67 69 76 65 6e | 20 74 6f 20 62 75 69 6c |be given| to buil|
|000013c0| 64 20 75 70 20 61 20 6d | 75 6c 74 69 2d 6c 69 6e |d up a m|ulti-lin|
|000013d0| 65 20 73 63 72 69 70 74 | 2e 0d 20 20 20 20 20 20 |e script|.. |
|000013e0| 20 20 20 20 49 66 20 2d | 65 20 69 73 20 20 67 69 | If -|e is gi|
|000013f0| 76 65 6e 2c 20 20 70 65 | 72 6c 20 20 77 69 6c 6c |ven, pe|rl will|
|00001400| 20 20 6e 6f 74 20 20 6c | 6f 6f 6b 20 20 66 6f 72 | not l|ook for|
|00001410| 20 20 61 20 20 73 63 72 | 69 70 74 0d 20 20 20 20 | a scr|ipt. |
|00001420| 20 20 20 20 20 20 66 69 | 6c 65 6e 61 6d 65 20 69 | fi|lename i|
|00001430| 6e 20 74 68 65 20 61 72 | 67 75 6d 65 6e 74 20 6c |n the ar|gument l|
|00001440| 69 73 74 2e 0d 0d 20 20 | 20 20 20 2d 69 65 78 74 |ist... | -iext|
|00001450| 65 6e 73 69 6f 6e 0d 20 | 20 20 20 20 20 20 20 20 |ension. | |
|00001460| 20 73 70 65 63 69 66 69 | 65 73 20 74 68 61 74 20 | specifi|es that |
|00001470| 66 69 6c 65 73 20 70 72 | 6f 63 65 73 73 65 64 20 |files pr|ocessed |
|00001480| 62 79 20 74 68 65 20 3c | 3e 20 63 6f 6e 73 74 72 |by the <|> constr|
|00001490| 75 63 74 20 20 61 72 65 | 0d 20 20 20 20 20 20 20 |uct are|. |
|000014a0| 20 20 20 74 6f 20 20 62 | 65 20 20 65 64 69 74 65 | to b|e edite|
|000014b0| 64 20 20 69 6e 2d 70 6c | 61 63 65 2e 20 20 49 74 |d in-pl|ace. It|
|000014c0| 20 64 6f 65 73 20 74 68 | 69 73 20 62 79 20 72 65 | does th|is by re|
|000014d0| 6e 61 6d 69 6e 67 20 74 | 68 65 0d 20 20 20 20 20 |naming t|he. |
|000014e0| 20 20 20 20 20 69 6e 70 | 75 74 20 66 69 6c 65 2c | inp|ut file,|
|000014f0| 20 6f 70 65 6e 69 6e 67 | 20 74 68 65 20 6f 75 74 | opening| the out|
|00001500| 70 75 74 20 66 69 6c 65 | 20 62 79 20 74 68 65 20 |put file| by the |
|00001510| 20 73 61 6d 65 20 20 6e | 61 6d 65 2c 0d 20 20 20 | same n|ame,. |
|00001520| 20 20 20 20 20 20 20 61 | 6e 64 20 73 65 6c 65 63 | a|nd selec|
|00001530| 74 69 6e 67 20 74 68 61 | 74 20 6f 75 74 70 75 74 |ting tha|t output|
|00001540| 20 66 69 6c 65 20 61 73 | 20 74 68 65 20 64 65 66 | file as| the def|
|00001550| 61 75 6c 74 20 66 6f 72 | 20 70 72 69 6e 74 0d 20 |ault for| print. |
|00001560| 20 20 20 20 20 20 20 20 | 20 73 74 61 74 65 6d 65 | | stateme|
|00001570| 6e 74 73 2e 20 20 54 68 | 65 20 65 78 74 65 6e 73 |nts. Th|e extens|
|00001580| 69 6f 6e 2c 20 69 66 20 | 73 75 70 70 6c 69 65 64 |ion, if |supplied|
|00001590| 2c 20 20 69 73 20 20 61 | 64 64 65 64 20 20 74 6f |, is a|dded to|
|000015a0| 0d 20 20 20 20 20 20 20 | 20 20 20 74 68 65 20 20 |. | the |
|000015b0| 6e 61 6d 65 20 6f 66 20 | 74 68 65 20 6f 6c 64 20 |name of |the old |
|000015c0| 66 69 6c 65 20 74 6f 20 | 6d 61 6b 65 20 61 20 62 |file to |make a b|
|000015d0| 61 63 6b 75 70 20 63 6f | 70 79 2e 20 20 49 66 20 |ackup co|py. If |
|000015e0| 6e 6f 0d 20 20 20 20 20 | 20 20 20 20 20 65 78 74 |no. | ext|
|000015f0| 65 6e 73 69 6f 6e 20 69 | 73 20 73 75 70 70 6c 69 |ension i|s suppli|
|00001600| 65 64 2c 20 6e 6f 20 62 | 61 63 6b 75 70 20 69 73 |ed, no b|ackup is|
|00001610| 20 6d 61 64 65 2e 20 20 | 53 61 79 69 6e 67 20 22 | made. |Saying "|
|00001620| 70 65 72 6c 0d 20 20 20 | 20 20 20 20 20 20 20 2d |perl. | -|
|00001630| 70 20 20 2d 69 2e 62 61 | 6b 20 20 2d 65 20 22 73 |p -i.ba|k -e "s|
|00001640| 2f 66 6f 6f 2f 62 61 72 | 2f 3b 22 20 2e 2e 2e 20 |/foo/bar|/;" ... |
|00001650| 22 20 69 73 20 74 68 65 | 20 73 61 6d 65 20 61 73 |" is the| same as|
|00001660| 20 75 73 69 6e 67 0d 20 | 20 20 20 20 20 20 20 20 | using. | |
|00001670| 20 74 68 65 20 73 63 72 | 69 70 74 3a 0d 0d 20 20 | the scr|ipt:.. |
|00001680| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 23 21 2f | | #!/|
|00001690| 75 73 72 2f 62 69 6e 2f | 70 65 72 6c 20 2d 70 69 |usr/bin/|perl -pi|
|000016a0| 2e 62 61 6b 0d 20 20 20 | 20 20 20 20 20 20 20 20 |.bak. | |
|000016b0| 20 20 20 20 73 2f 66 6f | 6f 2f 62 61 72 2f 3b 0d | s/fo|o/bar/;.|
|000016c0| 0d 20 20 20 20 20 20 20 | 20 20 20 77 68 69 63 68 |. | which|
|000016d0| 20 69 73 20 65 71 75 69 | 76 61 6c 65 6e 74 20 74 | is equi|valent t|
|000016e0| 6f 0d 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |o.. | |
|000016f0| 20 20 23 21 2f 75 73 72 | 2f 62 69 6e 2f 70 65 72 | #!/usr|/bin/per|
|00001700| 6c 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |l. | |
|00001710| 20 77 68 69 6c 65 20 28 | 3c 3e 29 20 7b 0d 20 20 | while (|<>) {. |
|00001720| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001730| 20 20 69 66 20 28 24 41 | 52 47 56 20 6e 65 20 24 | if ($A|RGV ne $|
|00001740| 6f 6c 64 61 72 67 76 29 | 20 7b 0d 20 20 20 20 20 |oldargv)| {. |
|00001750| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001760| 20 20 20 20 72 65 6e 61 | 6d 65 28 24 41 52 47 56 | rena|me($ARGV|
|00001770| 2c 20 24 41 52 47 56 20 | 2e 20 27 2e 62 61 6b 27 |, $ARGV |. '.bak'|
|00001780| 29 3b 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |);. | |
|00001790| 20 20 20 20 20 20 20 20 | 20 20 20 20 6f 70 65 6e | | open|
|000017a0| 28 41 52 47 56 4f 55 54 | 2c 20 22 3e 24 41 52 47 |(ARGVOUT|, ">$ARG|
|000017b0| 56 22 29 3b 0d 20 20 20 | 20 20 20 20 20 20 20 20 |V");. | |
|000017c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 73 65 | | se|
|000017d0| 6c 65 63 74 28 41 52 47 | 56 4f 55 54 29 3b 0d 20 |lect(ARG|VOUT);. |
|000017e0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000017f0| 20 20 20 20 20 20 20 20 | 24 6f 6c 64 61 72 67 76 | |$oldargv|
|00001800| 20 3d 20 24 41 52 47 56 | 3b 0d 20 20 20 20 20 20 | = $ARGV|;. |
|00001810| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 7d 0d | | }.|
|00001820| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001830| 20 20 20 20 73 2f 66 6f | 6f 2f 62 61 72 2f 3b 0d | s/fo|o/bar/;.|
|00001840| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 7d | | }|
|00001850| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00001860| 63 6f 6e 74 69 6e 75 65 | 20 7b 0d 20 20 20 20 20 |continue| {. |
|00001870| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 70 72 | | pr|
|00001880| 69 6e 74 3b 20 20 20 20 | 20 23 20 74 68 69 73 20 |int; | # this |
|00001890| 70 72 69 6e 74 73 20 74 | 6f 20 6f 72 69 67 69 6e |prints t|o origin|
|000018a0| 61 6c 20 66 69 6c 65 6e | 61 6d 65 0d 20 20 20 20 |al filen|ame. |
|000018b0| 20 20 20 20 20 20 20 20 | 20 20 20 7d 0d 20 20 20 | | }. |
|000018c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 73 65 6c 65 | | sele|
|000018d0| 63 74 28 53 54 44 4f 55 | 54 29 3b 0d 0d 20 20 20 |ct(STDOU|T);.. |
|000018e0| 20 20 20 20 20 20 20 65 | 78 63 65 70 74 20 74 68 | e|xcept th|
|000018f0| 61 74 20 74 68 65 20 2d | 69 20 66 6f 72 6d 20 64 |at the -|i form d|
|00001900| 6f 65 73 6e 27 74 20 6e | 65 65 64 20 74 6f 20 20 |oesn't n|eed to |
|00001910| 63 6f 6d 70 61 72 65 20 | 20 24 41 52 47 56 0d 20 |compare | $ARGV. |
|00001920| 20 20 20 20 20 20 20 20 | 20 74 6f 20 20 24 6f 6c | | to $ol|
|00001930| 64 61 72 67 76 20 74 6f | 20 6b 6e 6f 77 20 77 68 |dargv to| know wh|
|00001940| 65 6e 20 74 68 65 20 66 | 69 6c 65 6e 61 6d 65 20 |en the f|ilename |
|00001950| 68 61 73 20 63 68 61 6e | 67 65 64 2e 20 20 49 74 |has chan|ged. It|
|00001960| 0d 20 20 20 20 20 20 20 | 20 20 20 64 6f 65 73 2c |. | does,|
|00001970| 20 68 6f 77 65 76 65 72 | 2c 20 75 73 65 20 41 52 | however|, use AR|
|00001980| 47 56 4f 55 54 20 66 6f | 72 20 74 68 65 20 73 65 |GVOUT fo|r the se|
|00001990| 6c 65 63 74 65 64 20 66 | 69 6c 65 68 61 6e 64 6c |lected f|ilehandl|
|000019a0| 65 2e 0d 20 20 20 20 20 | 20 20 20 20 20 4e 6f 74 |e.. | Not|
|000019b0| 65 20 20 74 68 61 74 20 | 20 53 54 44 4f 55 54 20 |e that | STDOUT |
|000019c0| 20 69 73 20 20 72 65 73 | 74 6f 72 65 64 20 20 61 | is res|tored a|
|000019d0| 73 20 74 68 65 20 64 65 | 66 61 75 6c 74 20 6f 75 |s the de|fault ou|
|000019e0| 74 70 75 74 0d 20 20 20 | 20 20 20 20 20 20 20 66 |tput. | f|
|000019f0| 69 6c 65 68 61 6e 64 6c | 65 20 61 66 74 65 72 20 |ilehandl|e after |
|00001a00| 74 68 65 20 6c 6f 6f 70 | 2e 0d 0d 20 20 20 20 20 |the loop|... |
|00001a10| 20 20 20 20 20 59 6f 75 | 20 63 61 6e 20 75 73 65 | You| can use|
|00001a20| 20 65 6f 66 20 74 6f 20 | 6c 6f 63 61 74 65 20 74 | eof to |locate t|
|00001a30| 68 65 20 65 6e 64 20 6f | 66 20 65 61 63 68 20 20 |he end o|f each |
|00001a40| 69 6e 70 75 74 20 20 66 | 69 6c 65 2c 0d 20 20 20 |input f|ile,. |
|00001a50| 20 20 20 20 20 20 20 69 | 6e 20 20 63 61 73 65 20 | i|n case |
|00001a60| 79 6f 75 20 77 61 6e 74 | 20 74 6f 20 61 70 70 65 |you want| to appe|
|00001a70| 6e 64 20 74 6f 20 65 61 | 63 68 20 66 69 6c 65 2c |nd to ea|ch file,|
|00001a80| 20 6f 72 20 72 65 73 65 | 74 20 6c 69 6e 65 0d 20 | or rese|t line. |
|00001a90| 20 20 20 20 20 20 20 20 | 20 6e 75 6d 62 65 72 69 | | numberi|
|00001aa0| 6e 67 20 28 73 65 65 20 | 65 78 61 6d 70 6c 65 20 |ng (see |example |
|00001ab0| 75 6e 64 65 72 20 65 6f | 66 29 2e 0d 0d 20 20 20 |under eo|f)... |
|00001ac0| 20 20 2d 49 64 69 72 65 | 63 74 6f 72 79 0d 20 20 | -Idire|ctory. |
|00001ad0| 20 20 20 20 20 20 20 20 | 6d 61 79 20 62 65 20 75 | |may be u|
|00001ae0| 73 65 64 20 69 6e 20 20 | 63 6f 6e 6a 75 6e 63 74 |sed in |conjunct|
|00001af0| 69 6f 6e 20 20 77 69 74 | 68 20 20 2d 50 20 20 74 |ion wit|h -P t|
|00001b00| 6f 20 20 74 65 6c 6c 20 | 20 74 68 65 20 20 43 0d |o tell | the C.|
|00001b10| 20 20 20 20 20 20 20 20 | 20 20 70 72 65 70 72 6f | | prepro|
|00001b20| 63 65 73 73 6f 72 20 20 | 77 68 65 72 65 20 20 74 |cessor |where t|
|00001b30| 6f 20 20 6c 6f 6f 6b 20 | 20 66 6f 72 20 20 69 6e |o look | for in|
|00001b40| 63 6c 75 64 65 20 20 66 | 69 6c 65 73 2e 20 20 42 |clude f|iles. B|
|00001b50| 79 0d 20 20 20 20 20 20 | 20 20 20 20 64 65 66 61 |y. | defa|
|00001b60| 75 6c 74 20 2f 75 73 72 | 2f 69 6e 63 6c 75 64 65 |ult /usr|/include|
|00001b70| 20 61 6e 64 20 2f 75 73 | 72 2f 6c 69 62 2f 70 65 | and /us|r/lib/pe|
|00001b80| 72 6c 20 61 72 65 20 73 | 65 61 72 63 68 65 64 2e |rl are s|earched.|
|00001b90| 0d 0d 20 20 20 20 20 2d | 6c 6f 63 74 6e 75 6d 0d |.. -|loctnum.|
|00001ba0| 20 20 20 20 20 20 20 20 | 20 20 65 6e 61 62 6c 65 | | enable|
|00001bb0| 73 20 61 75 74 6f 6d 61 | 74 69 63 20 6c 69 6e 65 |s automa|tic line|
|00001bc0| 2d 65 6e 64 69 6e 67 20 | 70 72 6f 63 65 73 73 69 |-ending |processi|
|00001bd0| 6e 67 2e 20 20 49 74 20 | 20 68 61 73 20 20 74 77 |ng. It | has tw|
|00001be0| 6f 0d 20 20 20 20 20 20 | 20 20 20 20 65 66 66 65 |o. | effe|
|00001bf0| 63 74 73 3a 20 20 66 69 | 72 73 74 2c 20 69 74 20 |cts: fi|rst, it |
|00001c00| 61 75 74 6f 6d 61 74 69 | 63 61 6c 6c 79 20 63 68 |automati|cally ch|
|00001c10| 6f 70 73 20 74 68 65 20 | 6c 69 6e 65 20 74 65 72 |ops the |line ter|
|00001c20| 6d 69 2d 0d 20 20 20 20 | 20 20 20 20 20 20 6e 61 |mi-. | na|
|00001c30| 74 6f 72 20 77 68 65 6e | 20 75 73 65 64 20 77 69 |tor when| used wi|
|00001c40| 74 68 20 2d 6e 20 6f 72 | 20 2d 70 20 2c 20 61 6e |th -n or| -p , an|
|00001c50| 64 20 73 65 63 6f 6e 64 | 2c 20 69 74 20 20 61 73 |d second|, it as|
|00001c60| 73 69 67 6e 73 0d 20 20 | 20 20 20 20 20 20 20 20 |signs. | |
|00001c70| 24 5c 20 74 6f 20 68 61 | 76 65 20 74 68 65 20 76 |$\ to ha|ve the v|
|00001c80| 61 6c 75 65 20 6f 66 20 | 6f 63 74 6e 75 6d 20 73 |alue of |octnum s|
|00001c90| 6f 20 74 68 61 74 20 61 | 6e 79 20 70 72 69 6e 74 |o that a|ny print|
|00001ca0| 20 73 74 61 74 65 2d 0d | 20 20 20 20 20 20 20 20 | state-.| |
|00001cb0| 20 20 6d 65 6e 74 73 20 | 77 69 6c 6c 20 68 61 76 | ments |will hav|
|00001cc0| 65 20 74 68 61 74 20 6c | 69 6e 65 20 74 65 72 6d |e that l|ine term|
|00001cd0| 69 6e 61 74 6f 72 20 61 | 64 64 65 64 20 62 61 63 |inator a|dded bac|
|00001ce0| 6b 20 6f 6e 2e 20 20 49 | 66 0d 20 20 20 20 20 20 |k on. I|f. |
|00001cf0| 20 20 20 20 6f 63 74 6e | 75 6d 20 20 69 73 20 6f | octn|um is o|
|00001d00| 6d 69 74 74 65 64 2c 20 | 73 65 74 73 20 24 5c 20 |mitted, |sets $\ |
|00001d10| 74 6f 20 74 68 65 20 63 | 75 72 72 65 6e 74 20 76 |to the c|urrent v|
|00001d20| 61 6c 75 65 20 6f 66 20 | 24 2f 2e 0d 20 20 20 20 |alue of |$/.. |
|00001d30| 20 20 20 20 20 20 46 6f | 72 20 69 6e 73 74 61 6e | Fo|r instan|
|00001d40| 63 65 2c 20 74 6f 20 74 | 72 69 6d 20 6c 69 6e 65 |ce, to t|rim line|
|00001d50| 73 20 74 6f 20 38 30 20 | 63 6f 6c 75 6d 6e 73 3a |s to 80 |columns:|
|00001d60| 0d 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |.. | |
|00001d70| 20 70 65 72 6c 20 2d 6c | 70 65 20 27 73 75 62 73 | perl -l|pe 'subs|
|00001d80| 74 72 28 24 5f 2c 20 38 | 30 29 20 3d 20 22 22 27 |tr($_, 8|0) = ""'|
|00001d90| 0d 0d 20 20 20 20 20 20 | 20 20 20 20 4e 6f 74 65 |.. | Note|
|00001da0| 20 74 68 61 74 20 74 68 | 65 20 61 73 73 69 67 6e | that th|e assign|
|00001db0| 6d 65 6e 74 20 24 5c 20 | 20 3d 20 20 24 2f 20 20 |ment $\ | = $/ |
|00001dc0| 69 73 20 20 64 6f 6e 65 | 20 20 77 68 65 6e 20 20 |is done| when |
|00001dd0| 74 68 65 0d 20 20 20 20 | 20 20 20 20 20 20 73 77 |the. | sw|
|00001de0| 69 74 63 68 20 20 69 73 | 20 70 72 6f 63 65 73 73 |itch is| process|
|00001df0| 65 64 2c 20 73 6f 20 74 | 68 65 20 69 6e 70 75 74 |ed, so t|he input|
|00001e00| 20 72 65 63 6f 72 64 20 | 73 65 70 61 72 61 74 6f | record |separato|
|00001e10| 72 20 63 61 6e 0d 20 20 | 20 20 20 20 20 20 20 20 |r can. | |
|00001e20| 62 65 20 64 69 66 66 65 | 72 65 6e 74 20 74 68 61 |be diffe|rent tha|
|00001e30| 6e 20 74 68 65 20 6f 75 | 74 70 75 74 20 72 65 63 |n the ou|tput rec|
|00001e40| 6f 72 64 20 73 65 70 61 | 72 61 74 6f 72 20 69 66 |ord sepa|rator if|
|00001e50| 20 74 68 65 20 2d 6c 0d | 20 20 20 20 20 20 20 20 | the -l.| |
|00001e60| 20 20 73 77 69 74 63 68 | 20 69 73 20 66 6f 6c 6c | switch| is foll|
|00001e70| 6f 77 65 64 20 62 79 20 | 61 20 2d 30 20 73 77 69 |owed by |a -0 swi|
|00001e80| 74 63 68 3a 0d 0d 20 20 | 20 20 20 20 20 20 20 20 |tch:.. | |
|00001e90| 20 20 20 20 20 67 6e 75 | 66 69 6e 64 20 2f 20 2d | gnu|find / -|
|00001ea0| 70 72 69 6e 74 30 20 7c | 20 70 65 72 6c 20 2d 6c |print0 || perl -l|
|00001eb0| 6e 30 65 20 27 70 72 69 | 6e 74 20 22 66 6f 75 6e |n0e 'pri|nt "foun|
|00001ec0| 64 20 24 5f 22 20 69 66 | 20 2d 70 27 0d 0d 20 20 |d $_" if| -p'.. |
|00001ed0| 20 20 20 20 20 20 20 20 | 54 68 69 73 20 73 65 74 | |This set|
|00001ee0| 73 20 24 5c 20 74 6f 20 | 6e 65 77 6c 69 6e 65 20 |s $\ to |newline |
|00001ef0| 61 6e 64 20 74 68 65 6e | 20 73 65 74 73 20 24 2f |and then| sets $/|
|00001f00| 20 20 74 6f 20 20 74 68 | 65 20 20 6e 75 6c 6c 0d | to th|e null.|
|00001f10| 20 20 20 20 20 20 20 20 | 20 20 63 68 61 72 61 63 | | charac|
|00001f20| 74 65 72 2e 0d 0d 20 20 | 20 20 20 2d 6e 20 20 20 |ter... | -n |
|00001f30| 63 61 75 73 65 73 20 70 | 65 72 6c 20 74 6f 20 61 |causes p|erl to a|
|00001f40| 73 73 75 6d 65 20 74 68 | 65 20 66 6f 6c 6c 6f 77 |ssume th|e follow|
|00001f50| 69 6e 67 20 20 6c 6f 6f | 70 20 20 61 72 6f 75 6e |ing loo|p aroun|
|00001f60| 64 20 20 79 6f 75 72 0d | 20 20 20 20 20 20 20 20 |d your.| |
|00001f70| 20 20 73 63 72 69 70 74 | 2c 20 20 77 68 69 63 68 | script|, which|
|00001f80| 20 6d 61 6b 65 73 20 69 | 74 20 69 74 65 72 61 74 | makes i|t iterat|
|00001f90| 65 20 6f 76 65 72 20 66 | 69 6c 65 6e 61 6d 65 20 |e over f|ilename |
|00001fa0| 61 72 67 75 6d 65 6e 74 | 73 0d 20 20 20 20 20 20 |argument|s. |
|00001fb0| 20 20 20 20 73 6f 6d 65 | 77 68 61 74 20 6c 69 6b | some|what lik|
|00001fc0| 65 20 22 73 65 64 20 2d | 6e 22 20 6f 72 20 61 77 |e "sed -|n" or aw|
|00001fd0| 6b 3a 0d 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 |k:.. | |
|00001fe0| 20 20 20 77 68 69 6c 65 | 20 28 3c 3e 29 20 7b 0d | while| (<>) {.|
|00001ff0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002000| 20 20 20 20 2e 2e 2e 20 | 20 20 20 20 20 20 23 20 | ... | # |
|00002010| 79 6f 75 72 20 73 63 72 | 69 70 74 20 67 6f 65 73 |your scr|ipt goes|
|00002020| 20 68 65 72 65 0d 20 20 | 20 20 20 20 20 20 20 20 | here. | |
|00002030| 20 20 20 20 20 7d 0d 0d | 20 20 20 20 20 20 20 20 | }..| |
|00002040| 20 20 4e 6f 74 65 20 74 | 68 61 74 20 74 68 65 20 | Note t|hat the |
|00002050| 6c 69 6e 65 73 20 61 72 | 65 20 6e 6f 74 20 70 72 |lines ar|e not pr|
|00002060| 69 6e 74 65 64 20 62 79 | 20 64 65 66 61 75 6c 74 |inted by| default|
|00002070| 2e 20 20 53 65 65 20 2d | 70 0d 20 20 20 20 20 20 |. See -|p. |
|00002080| 20 20 20 20 74 6f 20 20 | 68 61 76 65 20 20 6c 69 | to |have li|
|00002090| 6e 65 73 20 20 70 72 69 | 6e 74 65 64 2e 20 20 20 |nes pri|nted. |
|000020a0| 48 65 72 65 20 69 73 20 | 61 6e 20 65 66 66 69 63 |Here is |an effic|
|000020b0| 69 65 6e 74 20 77 61 79 | 20 74 6f 0d 20 20 20 20 |ient way| to. |
|000020c0| 20 20 20 20 20 20 64 65 | 6c 65 74 65 20 61 6c 6c | de|lete all|
|000020d0| 20 66 69 6c 65 73 20 6f | 6c 64 65 72 20 74 68 61 | files o|lder tha|
|000020e0| 6e 20 61 20 77 65 65 6b | 3a 0d 0d 20 20 20 20 20 |n a week|:.. |
|000020f0| 20 20 20 20 20 20 20 20 | 20 20 66 69 6e 64 20 2e | | find .|
|00002100| 20 2d 6d 74 69 6d 65 20 | 2b 37 20 2d 70 72 69 6e | -mtime |+7 -prin|
|00002110| 74 20 7c 20 70 65 72 6c | 20 2d 6e 6c 65 20 27 75 |t | perl| -nle 'u|
|00002120| 6e 6c 69 6e 6b 3b 27 0d | 0d 20 20 20 20 20 20 20 |nlink;'.|. |
|00002130| 20 20 20 54 68 69 73 20 | 69 73 20 66 61 73 74 65 | This |is faste|
|00002140| 72 20 74 68 61 6e 20 75 | 73 69 6e 67 20 20 74 68 |r than u|sing th|
|00002150| 65 20 20 2d 65 78 65 63 | 20 20 73 77 69 74 63 68 |e -exec| switch|
|00002160| 20 20 6f 66 20 20 66 69 | 6e 64 0d 20 20 20 20 20 | of fi|nd. |
|00002170| 20 20 20 20 20 62 65 63 | 61 75 73 65 20 20 79 6f | bec|ause yo|
|00002180| 75 20 20 64 6f 6e 27 74 | 20 20 68 61 76 65 20 20 |u don't| have |
|00002190| 74 6f 20 20 73 74 61 72 | 74 20 61 20 70 72 6f 63 |to star|t a proc|
|000021a0| 65 73 73 20 6f 6e 20 65 | 76 65 72 79 0d 20 20 20 |ess on e|very. |
|000021b0| 20 20 20 20 20 20 20 66 | 69 6c 65 6e 61 6d 65 20 | f|ilename |
|000021c0| 66 6f 75 6e 64 2e 0d 0d | 20 20 20 20 20 2d 70 20 |found...| -p |
|000021d0| 20 20 63 61 75 73 65 73 | 20 70 65 72 6c 20 74 6f | causes| perl to|
|000021e0| 20 61 73 73 75 6d 65 20 | 74 68 65 20 66 6f 6c 6c | assume |the foll|
|000021f0| 6f 77 69 6e 67 20 20 6c | 6f 6f 70 20 20 61 72 6f |owing l|oop aro|
|00002200| 75 6e 64 20 20 79 6f 75 | 72 0d 20 20 20 20 20 20 |und you|r. |
|00002210| 20 20 20 20 73 63 72 69 | 70 74 2c 20 20 77 68 69 | scri|pt, whi|
|00002220| 63 68 20 6d 61 6b 65 73 | 20 69 74 20 69 74 65 72 |ch makes| it iter|
|00002230| 61 74 65 20 6f 76 65 72 | 20 66 69 6c 65 6e 61 6d |ate over| filenam|
|00002240| 65 20 61 72 67 75 6d 65 | 6e 74 73 0d 20 20 20 20 |e argume|nts. |
|00002250| 20 20 20 20 20 20 73 6f | 6d 65 77 68 61 74 20 6c | so|mewhat l|
|00002260| 69 6b 65 20 73 65 64 3a | 0d 0d 20 20 20 20 20 20 |ike sed:|.. |
|00002270| 20 20 20 20 20 20 20 20 | 20 77 68 69 6c 65 20 28 | | while (|
|00002280| 3c 3e 29 20 7b 0d 20 20 | 20 20 20 20 20 20 20 20 |<>) {. | |
|00002290| 20 20 20 20 20 20 20 20 | 20 20 2e 2e 2e 20 20 20 | | ... |
|000022a0| 20 20 20 20 23 20 79 6f | 75 72 20 73 63 72 69 70 | # yo|ur scrip|
|000022b0| 74 20 67 6f 65 73 20 68 | 65 72 65 0d 20 20 20 20 |t goes h|ere. |
|000022c0| 20 20 20 20 20 20 20 20 | 20 20 20 7d 20 63 6f 6e | | } con|
|000022d0| 74 69 6e 75 65 20 7b 0d | 20 20 20 20 20 20 20 20 |tinue {.| |
|000022e0| 20 20 20 20 20 20 20 20 | 20 20 20 20 70 72 69 6e | | prin|
|000022f0| 74 3b 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |t;. | |
|00002300| 20 20 7d 0d 0d 20 20 20 | 20 20 20 20 20 20 20 4e | }.. | N|
|00002310| 6f 74 65 20 74 68 61 74 | 20 74 68 65 20 20 6c 69 |ote that| the li|
|00002320| 6e 65 73 20 20 61 72 65 | 20 20 70 72 69 6e 74 65 |nes are| printe|
|00002330| 64 20 20 61 75 74 6f 6d | 61 74 69 63 61 6c 6c 79 |d autom|atically|
|00002340| 2e 20 20 20 54 6f 0d 20 | 20 20 20 20 20 20 20 20 |. To. | |
|00002350| 20 73 75 70 70 72 65 73 | 73 20 20 70 72 69 6e 74 | suppres|s print|
|00002360| 69 6e 67 20 75 73 65 20 | 74 68 65 20 2d 6e 20 73 |ing use |the -n s|
|00002370| 77 69 74 63 68 2e 20 20 | 41 20 2d 70 20 6f 76 65 |witch. |A -p ove|
|00002380| 72 72 69 64 65 73 20 61 | 0d 20 20 20 20 20 20 20 |rrides a|. |
|00002390| 20 20 20 2d 6e 20 73 77 | 69 74 63 68 2e 0d 0d 20 | -n sw|itch... |
|000023a0| 20 20 20 20 2d 50 20 20 | 20 63 61 75 73 65 73 20 | -P | causes |
|000023b0| 79 6f 75 72 20 73 63 72 | 69 70 74 20 74 6f 20 62 |your scr|ipt to b|
|000023c0| 65 20 72 75 6e 20 74 68 | 72 6f 75 67 68 20 74 68 |e run th|rough th|
|000023d0| 65 20 43 20 70 72 65 70 | 72 6f 63 65 73 73 6f 72 |e C prep|rocessor|
|000023e0| 0d 20 20 20 20 20 20 20 | 20 20 20 62 65 66 6f 72 |. | befor|
|000023f0| 65 20 20 63 6f 6d 70 69 | 6c 61 74 69 6f 6e 20 20 |e compi|lation |
|00002400| 62 79 20 70 65 72 6c 2e | 20 20 28 53 69 6e 63 65 |by perl.| (Since|
|00002410| 20 62 6f 74 68 20 63 6f | 6d 6d 65 6e 74 73 20 61 | both co|mments a|
|00002420| 6e 64 0d 20 20 20 20 20 | 20 20 20 20 20 63 70 70 |nd. | cpp|
|00002430| 20 64 69 72 65 63 74 69 | 76 65 73 20 62 65 67 69 | directi|ves begi|
|00002440| 6e 20 77 69 74 68 20 74 | 68 65 20 23 20 63 68 61 |n with t|he # cha|
|00002450| 72 61 63 74 65 72 2c 20 | 20 79 6f 75 20 20 73 68 |racter, | you sh|
|00002460| 6f 75 6c 64 0d 20 20 20 | 20 20 20 20 20 20 20 61 |ould. | a|
|00002470| 76 6f 69 64 20 20 73 74 | 61 72 74 69 6e 67 20 20 |void st|arting |
|00002480| 63 6f 6d 6d 65 6e 74 73 | 20 20 77 69 74 68 20 61 |comments| with a|
|00002490| 6e 79 20 77 6f 72 64 73 | 20 72 65 63 6f 67 6e 69 |ny words| recogni|
|000024a0| 7a 65 64 20 62 79 0d 20 | 20 20 20 20 20 20 20 20 |zed by. | |
|000024b0| 20 74 68 65 20 43 20 70 | 72 65 70 72 6f 63 65 73 | the C p|reproces|
|000024c0| 73 6f 72 20 73 75 63 68 | 20 61 73 20 22 69 66 22 |sor such| as "if"|
|000024d0| 2c 20 22 65 6c 73 65 22 | 20 6f 72 20 22 64 65 66 |, "else"| or "def|
|000024e0| 69 6e 65 22 2e 29 0d 0d | 20 20 20 20 20 2d 73 20 |ine".)..| -s |
|000024f0| 20 20 65 6e 61 62 6c 65 | 73 20 73 6f 6d 65 20 72 | enable|s some r|
|00002500| 75 64 69 6d 65 6e 74 61 | 72 79 20 73 77 69 74 63 |udimenta|ry switc|
|00002510| 68 20 70 61 72 73 69 6e | 67 20 66 6f 72 20 73 77 |h parsin|g for sw|
|00002520| 69 74 63 68 65 73 20 6f | 6e 0d 20 20 20 20 20 20 |itches o|n. |
|00002530| 20 20 20 20 74 68 65 20 | 20 63 6f 6d 6d 61 6e 64 | the | command|
|00002540| 20 20 6c 69 6e 65 20 61 | 66 74 65 72 20 74 68 65 | line a|fter the|
|00002550| 20 73 63 72 69 70 74 20 | 6e 61 6d 65 20 62 75 74 | script |name but|
|00002560| 20 62 65 66 6f 72 65 20 | 61 6e 79 0d 20 20 20 20 | before |any. |
|00002570| 20 20 20 20 20 20 66 69 | 6c 65 6e 61 6d 65 20 61 | fi|lename a|
|00002580| 72 67 75 6d 65 6e 74 73 | 20 28 6f 72 20 62 65 66 |rguments| (or bef|
|00002590| 6f 72 65 20 61 20 2d 2d | 29 2e 20 20 41 6e 79 20 |ore a --|). Any |
|000025a0| 73 77 69 74 63 68 20 20 | 66 6f 75 6e 64 0d 20 20 |switch |found. |
|000025b0| 20 20 20 20 20 20 20 20 | 74 68 65 72 65 20 20 69 | |there i|
|000025c0| 73 20 72 65 6d 6f 76 65 | 64 20 66 72 6f 6d 20 40 |s remove|d from @|
|000025d0| 41 52 47 56 20 61 6e 64 | 20 73 65 74 73 20 74 68 |ARGV and| sets th|
|000025e0| 65 20 63 6f 72 72 65 73 | 70 6f 6e 64 69 6e 67 0d |e corres|ponding.|
|000025f0| 20 20 20 20 20 20 20 20 | 20 20 76 61 72 69 61 62 | | variab|
|00002600| 6c 65 20 69 6e 20 74 68 | 65 20 20 70 65 72 6c 20 |le in th|e perl |
|00002610| 20 73 63 72 69 70 74 2e | 20 20 20 54 68 65 20 20 | script.| The |
|00002620| 66 6f 6c 6c 6f 77 69 6e | 67 20 20 73 63 72 69 70 |followin|g scrip|
|00002630| 74 0d 20 20 20 20 20 20 | 20 20 20 20 70 72 69 6e |t. | prin|
|00002640| 74 73 20 22 74 72 75 65 | 22 20 69 66 20 61 6e 64 |ts "true|" if and|
|00002650| 20 6f 6e 6c 79 20 69 66 | 20 74 68 65 20 73 63 72 | only if| the scr|
|00002660| 69 70 74 20 69 73 20 69 | 6e 76 6f 6b 65 64 20 77 |ipt is i|nvoked w|
|00002670| 69 74 68 0d 20 20 20 20 | 20 20 20 20 20 20 61 20 |ith. | a |
|00002680| 2d 78 79 7a 20 73 77 69 | 74 63 68 2e 0d 0d 20 20 |-xyz swi|tch... |
|00002690| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 23 21 2f | | #!/|
|000026a0| 75 73 72 2f 62 69 6e 2f | 70 65 72 6c 20 2d 73 0d |usr/bin/|perl -s.|
|000026b0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 69 | | i|
|000026c0| 66 20 28 24 78 79 7a 29 | 20 7b 20 70 72 69 6e 74 |f ($xyz)| { print|
|000026d0| 20 22 74 72 75 65 5c 6e | 22 3b 20 7d 0d 0d 20 20 | "true\n|"; }.. |
|000026e0| 20 20 20 2d 53 20 20 20 | 6d 61 6b 65 73 20 70 65 | -S |makes pe|
|000026f0| 72 6c 20 75 73 65 20 74 | 68 65 20 50 41 54 48 20 |rl use t|he PATH |
|00002700| 65 6e 76 69 72 6f 6e 6d | 65 6e 74 20 76 61 72 69 |environm|ent vari|
|00002710| 61 62 6c 65 20 74 6f 20 | 20 73 65 61 72 63 68 0d |able to | search.|
|00002720| 20 20 20 20 20 20 20 20 | 20 20 66 6f 72 20 20 74 | | for t|
|00002730| 68 65 20 20 73 63 72 69 | 70 74 20 20 28 75 6e 6c |he scri|pt (unl|
|00002740| 65 73 73 20 74 68 65 20 | 6e 61 6d 65 20 6f 66 20 |ess the |name of |
|00002750| 74 68 65 20 73 63 72 69 | 70 74 20 73 74 61 72 74 |the scri|pt start|
|00002760| 73 0d 20 20 20 20 20 20 | 20 20 20 20 77 69 74 68 |s. | with|
|00002770| 20 61 20 73 6c 61 73 68 | 29 2e 20 20 54 79 70 69 | a slash|). Typi|
|00002780| 63 61 6c 6c 79 20 74 68 | 69 73 20 69 73 20 75 73 |cally th|is is us|
|00002790| 65 64 20 20 74 6f 20 20 | 65 6d 75 6c 61 74 65 20 |ed to |emulate |
|000027a0| 20 23 21 0d 20 20 20 20 | 20 20 20 20 20 20 73 74 | #!. | st|
|000027b0| 61 72 74 75 70 20 20 6f | 6e 20 6d 61 63 68 69 6e |artup o|n machin|
|000027c0| 65 73 20 74 68 61 74 20 | 64 6f 6e 27 74 20 73 75 |es that |don't su|
|000027d0| 70 70 6f 72 74 20 23 21 | 2c 20 69 6e 20 74 68 65 |pport #!|, in the|
|000027e0| 20 66 6f 6c 2d 0d 20 20 | 20 20 20 20 20 20 20 20 | fol-. | |
|000027f0| 6c 6f 77 69 6e 67 20 6d | 61 6e 6e 65 72 3a 0d 0d |lowing m|anner:..|
|00002800| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 23 | | #|
|00002810| 21 2f 75 73 72 2f 62 69 | 6e 2f 70 65 72 6c 0d 20 |!/usr/bi|n/perl. |
|00002820| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 65 76 | | ev|
|00002830| 61 6c 20 22 65 78 65 63 | 20 2f 75 73 72 2f 62 69 |al "exec| /usr/bi|
|00002840| 6e 2f 70 65 72 6c 20 2d | 53 20 24 30 20 24 2a 22 |n/perl -|S $0 $*"|
|00002850| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00002860| 20 20 20 20 20 69 66 20 | 24 72 75 6e 6e 69 6e 67 | if |$running|
|00002870| 5f 75 6e 64 65 72 5f 73 | 6f 6d 65 5f 73 68 65 6c |_under_s|ome_shel|
|00002880| 6c 3b 0d 0d 20 20 20 20 | 20 20 20 20 20 20 54 68 |l;.. | Th|
|00002890| 65 20 73 79 73 74 65 6d | 20 69 67 6e 6f 72 65 73 |e system| ignores|
|000028a0| 20 74 68 65 20 66 69 72 | 73 74 20 6c 69 6e 65 20 | the fir|st line |
|000028b0| 61 6e 64 20 66 65 65 64 | 73 20 74 68 65 20 20 73 |and feed|s the s|
|000028c0| 63 72 69 70 74 0d 20 20 | 20 20 20 20 20 20 20 20 |cript. | |
|000028d0| 74 6f 20 20 2f 62 69 6e | 2f 73 68 2c 20 20 77 68 |to /bin|/sh, wh|
|000028e0| 69 63 68 20 70 72 6f 63 | 65 65 64 73 20 74 6f 20 |ich proc|eeds to |
|000028f0| 74 72 79 20 74 6f 20 65 | 78 65 63 75 74 65 20 74 |try to e|xecute t|
|00002900| 68 65 20 70 65 72 6c 0d | 20 20 20 20 20 20 20 20 |he perl.| |
|00002910| 20 20 73 63 72 69 70 74 | 20 61 73 20 61 20 20 73 | script| as a s|
|00002920| 68 65 6c 6c 20 20 73 63 | 72 69 70 74 2e 20 20 20 |hell sc|ript. |
|00002930| 54 68 65 20 20 73 68 65 | 6c 6c 20 20 65 78 65 63 |The she|ll exec|
|00002940| 75 74 65 73 20 20 74 68 | 65 0d 20 20 20 20 20 20 |utes th|e. |
|00002950| 20 20 20 20 73 65 63 6f | 6e 64 20 20 6c 69 6e 65 | seco|nd line|
|00002960| 20 61 73 20 61 20 6e 6f | 72 6d 61 6c 20 73 68 65 | as a no|rmal she|
|00002970| 6c 6c 20 63 6f 6d 6d 61 | 6e 64 2c 20 61 6e 64 20 |ll comma|nd, and |
|00002980| 74 68 75 73 20 73 74 61 | 72 74 73 0d 20 20 20 20 |thus sta|rts. |
|00002990| 20 20 20 20 20 20 75 70 | 20 74 68 65 20 70 65 72 | up| the per|
|000029a0| 6c 20 69 6e 74 65 72 70 | 72 65 74 65 72 2e 20 20 |l interp|reter. |
|000029b0| 4f 6e 20 73 6f 6d 65 20 | 20 73 79 73 74 65 6d 73 |On some | systems|
|000029c0| 20 20 24 30 20 20 64 6f | 65 73 6e 27 74 0d 20 20 | $0 do|esn't. |
|000029d0| 20 20 20 20 20 20 20 20 | 61 6c 77 61 79 73 20 20 | |always |
|000029e0| 63 6f 6e 74 61 69 6e 20 | 74 68 65 20 66 75 6c 6c |contain |the full|
|000029f0| 20 70 61 74 68 6e 61 6d | 65 2c 20 73 6f 20 74 68 | pathnam|e, so th|
|00002a00| 65 20 2d 53 20 74 65 6c | 6c 73 20 70 65 72 6c 0d |e -S tel|ls perl.|
|00002a10| 20 20 20 20 20 20 20 20 | 20 20 74 6f 20 73 65 61 | | to sea|
|00002a20| 72 63 68 20 66 6f 72 20 | 74 68 65 20 20 73 63 72 |rch for |the scr|
|00002a30| 69 70 74 20 20 69 66 20 | 20 6e 65 63 65 73 73 61 |ipt if | necessa|
|00002a40| 72 79 2e 20 20 20 41 66 | 74 65 72 20 20 70 65 72 |ry. Af|ter per|
|00002a50| 6c 0d 20 20 20 20 20 20 | 20 20 20 20 6c 6f 63 61 |l. | loca|
|00002a60| 74 65 73 20 20 74 68 65 | 20 20 73 63 72 69 70 74 |tes the| script|
|00002a70| 2c 20 20 69 74 20 20 70 | 61 72 73 65 73 20 74 68 |, it p|arses th|
|00002a80| 65 20 6c 69 6e 65 73 20 | 61 6e 64 20 69 67 6e 6f |e lines |and igno|
|00002a90| 72 65 73 0d 20 20 20 20 | 20 20 20 20 20 20 74 68 |res. | th|
|00002aa0| 65 6d 20 62 65 63 61 75 | 73 65 20 74 68 65 20 76 |em becau|se the v|
|00002ab0| 61 72 69 61 62 6c 65 20 | 24 72 75 6e 6e 69 6e 67 |ariable |$running|
|00002ac0| 5f 75 6e 64 65 72 5f 73 | 6f 6d 65 5f 73 68 65 6c |_under_s|ome_shel|
|00002ad0| 6c 20 20 69 73 0d 20 20 | 20 20 20 20 20 20 20 20 |l is. | |
|00002ae0| 6e 65 76 65 72 20 20 74 | 72 75 65 2e 20 20 20 41 |never t|rue. A|
|00002af0| 20 20 62 65 74 74 65 72 | 20 20 63 6f 6e 73 74 72 | better| constr|
|00002b00| 75 63 74 20 20 74 68 61 | 6e 20 20 24 2a 20 20 77 |uct tha|n $* w|
|00002b10| 6f 75 6c 64 20 62 65 0d | 20 20 20 20 20 20 20 20 |ould be.| |
|00002b20| 20 20 24 7b 31 2b 22 24 | 40 22 7d 2c 20 77 68 69 | ${1+"$|@"}, whi|
|00002b30| 63 68 20 68 61 6e 64 6c | 65 73 20 65 6d 62 65 64 |ch handl|es embed|
|00002b40| 64 65 64 20 73 70 61 63 | 65 73 20 20 61 6e 64 20 |ded spac|es and |
|00002b50| 20 73 75 63 68 20 20 69 | 6e 0d 20 20 20 20 20 20 | such i|n. |
|00002b60| 20 20 20 20 74 68 65 20 | 20 66 69 6c 65 6e 61 6d | the | filenam|
|00002b70| 65 73 2c 20 62 75 74 20 | 64 6f 65 73 6e 27 74 20 |es, but |doesn't |
|00002b80| 77 6f 72 6b 20 69 66 20 | 74 68 65 20 73 63 72 69 |work if |the scri|
|00002b90| 70 74 20 69 73 20 62 65 | 69 6e 67 0d 20 20 20 20 |pt is be|ing. |
|00002ba0| 20 20 20 20 20 20 69 6e | 74 65 72 70 72 65 74 65 | in|terprete|
|00002bb0| 64 20 62 79 20 63 73 68 | 2e 20 20 49 6e 20 6f 72 |d by csh|. In or|
|00002bc0| 64 65 72 20 74 6f 20 20 | 73 74 61 72 74 20 20 75 |der to |start u|
|00002bd0| 70 20 20 73 68 20 20 72 | 61 74 68 65 72 0d 20 20 |p sh r|ather. |
|00002be0| 20 20 20 20 20 20 20 20 | 74 68 61 6e 20 20 63 73 | |than cs|
|00002bf0| 68 2c 20 73 6f 6d 65 20 | 73 79 73 74 65 6d 73 20 |h, some |systems |
|00002c00| 6d 61 79 20 68 61 76 65 | 20 74 6f 20 72 65 70 6c |may have| to repl|
|00002c10| 61 63 65 20 74 68 65 20 | 23 21 20 6c 69 6e 65 0d |ace the |#! line.|
|00002c20| 20 20 20 20 20 20 20 20 | 20 20 77 69 74 68 20 61 | | with a|
|00002c30| 20 6c 69 6e 65 20 63 6f | 6e 74 61 69 6e 69 6e 67 | line co|ntaining|
|00002c40| 20 6a 75 73 74 20 61 20 | 63 6f 6c 6f 6e 2c 20 77 | just a |colon, w|
|00002c50| 68 69 63 68 20 77 69 6c | 6c 20 62 65 20 70 6f 6c |hich wil|l be pol|
|00002c60| 2d 0d 20 20 20 20 20 20 | 20 20 20 20 69 74 65 6c |-. | itel|
|00002c70| 79 20 20 69 67 6e 6f 72 | 65 64 20 20 62 79 20 20 |y ignor|ed by |
|00002c80| 70 65 72 6c 2e 20 20 20 | 4f 74 68 65 72 20 73 79 |perl. |Other sy|
|00002c90| 73 74 65 6d 73 20 63 61 | 6e 27 74 20 63 6f 6e 74 |stems ca|n't cont|
|00002ca0| 72 6f 6c 0d 20 20 20 20 | 20 20 20 20 20 20 74 68 |rol. | th|
|00002cb0| 61 74 2c 20 61 6e 64 20 | 6e 65 65 64 20 61 20 74 |at, and |need a t|
|00002cc0| 6f 74 61 6c 6c 79 20 64 | 65 76 69 6f 75 73 20 20 |otally d|evious |
|00002cd0| 63 6f 6e 73 74 72 75 63 | 74 20 20 74 68 61 74 20 |construc|t that |
|00002ce0| 20 77 69 6c 6c 0d 20 20 | 20 20 20 20 20 20 20 20 | will. | |
|00002cf0| 77 6f 72 6b 20 20 75 6e | 64 65 72 20 61 6e 79 20 |work un|der any |
|00002d00| 6f 66 20 63 73 68 2c 20 | 73 68 20 6f 72 20 70 65 |of csh, |sh or pe|
|00002d10| 72 6c 2c 20 73 75 63 68 | 20 61 73 20 74 68 65 20 |rl, such| as the |
|00002d20| 66 6f 6c 6c 6f 77 2d 0d | 20 20 20 20 20 20 20 20 |follow-.| |
|00002d30| 20 20 69 6e 67 3a 0d 0d | 20 20 20 20 20 20 20 20 | ing:..| |
|00002d40| 20 20 20 20 20 20 20 65 | 76 61 6c 20 27 28 65 78 | e|val '(ex|
|00002d50| 69 74 20 24 3f 30 29 27 | 20 26 26 20 65 76 61 6c |it $?0)'| && eval|
|00002d60| 20 27 65 78 65 63 20 2f | 75 73 72 2f 62 69 6e 2f | 'exec /|usr/bin/|
|00002d70| 70 65 72 6c 20 2d 53 20 | 24 30 20 24 7b 31 2b 22 |perl -S |$0 ${1+"|
|00002d80| 24 40 22 7d 27 0d 20 20 | 20 20 20 20 20 20 20 20 |$@"}'. | |
|00002d90| 20 20 20 20 20 26 20 65 | 76 61 6c 20 27 65 78 65 | & e|val 'exe|
|00002da0| 63 20 2f 75 73 72 2f 62 | 69 6e 2f 70 65 72 6c 20 |c /usr/b|in/perl |
|00002db0| 2d 53 20 24 30 20 24 61 | 72 67 76 3a 71 27 0d 20 |-S $0 $a|rgv:q'. |
|00002dc0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002dd0| 20 20 20 69 66 20 30 3b | 0d 0d 20 20 20 20 20 2d | if 0;|.. -|
|00002de0| 75 20 20 20 63 61 75 73 | 65 73 20 70 65 72 6c 20 |u caus|es perl |
|00002df0| 74 6f 20 64 75 6d 70 20 | 63 6f 72 65 20 61 66 74 |to dump |core aft|
|00002e00| 65 72 20 63 6f 6d 70 69 | 6c 69 6e 67 20 20 79 6f |er compi|ling yo|
|00002e10| 75 72 20 20 73 63 72 69 | 70 74 2e 0d 20 20 20 20 |ur scri|pt.. |
|00002e20| 20 20 20 20 20 20 59 6f | 75 20 20 63 61 6e 20 20 | Yo|u can |
|00002e30| 74 68 65 6e 20 20 74 61 | 6b 65 20 74 68 69 73 20 |then ta|ke this |
|00002e40| 63 6f 72 65 20 64 75 6d | 70 20 61 6e 64 20 74 75 |core dum|p and tu|
|00002e50| 72 6e 20 69 74 20 69 6e | 74 6f 20 61 6e 0d 20 20 |rn it in|to an. |
|00002e60| 20 20 20 20 20 20 20 20 | 65 78 65 63 75 74 61 62 | |executab|
|00002e70| 6c 65 20 66 69 6c 65 20 | 62 79 20 75 73 69 6e 67 |le file |by using|
|00002e80| 20 74 68 65 20 75 6e 64 | 75 6d 70 20 70 72 6f 67 | the und|ump prog|
|00002e90| 72 61 6d 20 20 28 6e 6f | 74 20 20 73 75 70 2d 0d |ram (no|t sup-.|
|00002ea0| 20 20 20 20 20 20 20 20 | 20 20 70 6c 69 65 64 29 | | plied)|
|00002eb0| 2e 20 20 20 54 68 69 73 | 20 20 73 70 65 65 64 73 |. This| speeds|
|00002ec0| 20 20 73 74 61 72 74 75 | 70 20 20 61 74 20 74 68 | startu|p at th|
|00002ed0| 65 20 65 78 70 65 6e 73 | 65 20 6f 66 20 73 6f 6d |e expens|e of som|
|00002ee0| 65 0d 20 20 20 20 20 20 | 20 20 20 20 64 69 73 6b |e. | disk|
|00002ef0| 20 73 70 61 63 65 20 28 | 77 68 69 63 68 20 79 6f | space (|which yo|
|00002f00| 75 20 63 61 6e 20 20 6d | 69 6e 69 6d 69 7a 65 20 |u can m|inimize |
|00002f10| 20 62 79 20 20 73 74 72 | 69 70 70 69 6e 67 20 20 | by str|ipping |
|00002f20| 74 68 65 0d 20 20 20 20 | 20 20 20 20 20 20 65 78 |the. | ex|
|00002f30| 65 63 75 74 61 62 6c 65 | 29 2e 20 20 20 28 53 74 |ecutable|). (St|
|00002f40| 69 6c 6c 2c 20 61 20 22 | 68 65 6c 6c 6f 20 77 6f |ill, a "|hello wo|
|00002f50| 72 6c 64 22 20 65 78 65 | 63 75 74 61 62 6c 65 20 |rld" exe|cutable |
|00002f60| 63 6f 6d 65 73 0d 20 20 | 20 20 20 20 20 20 20 20 |comes. | |
|00002f70| 6f 75 74 20 74 6f 20 61 | 62 6f 75 74 20 32 30 30 |out to a|bout 200|
|00002f80| 4b 20 6f 6e 20 6d 79 20 | 6d 61 63 68 69 6e 65 2e |K on my |machine.|
|00002f90| 29 20 49 66 20 79 6f 75 | 20 61 72 65 20 20 67 6f |) If you| are go|
|00002fa0| 69 6e 67 20 20 74 6f 0d | 20 20 20 20 20 20 20 20 |ing to.| |
|00002fb0| 20 20 72 75 6e 20 79 6f | 75 72 20 65 78 65 63 75 | run yo|ur execu|
|00002fc0| 74 61 62 6c 65 20 61 73 | 20 61 20 73 65 74 2d 69 |table as| a set-i|
|00002fd0| 64 20 70 72 6f 67 72 61 | 6d 20 74 68 65 6e 20 79 |d progra|m then y|
|00002fe0| 6f 75 20 73 68 6f 75 6c | 64 0d 20 20 20 20 20 20 |ou shoul|d. |
|00002ff0| 20 20 20 20 70 72 6f 62 | 61 62 6c 79 20 63 6f 6d | prob|ably com|
|00003000| 70 69 6c 65 20 69 74 20 | 75 73 69 6e 67 20 74 61 |pile it |using ta|
|00003010| 69 6e 74 70 65 72 6c 20 | 72 61 74 68 65 72 20 74 |intperl |rather t|
|00003020| 68 61 6e 20 20 6e 6f 72 | 6d 61 6c 0d 20 20 20 20 |han nor|mal. |
|00003030| 20 20 20 20 20 20 70 65 | 72 6c 2e 20 20 20 49 66 | pe|rl. If|
|00003040| 20 79 6f 75 20 77 61 6e | 74 20 74 6f 20 65 78 65 | you wan|t to exe|
|00003050| 63 75 74 65 20 61 20 70 | 6f 72 74 69 6f 6e 20 6f |cute a p|ortion o|
|00003060| 66 20 79 6f 75 72 20 73 | 63 72 69 70 74 0d 20 20 |f your s|cript. |
|00003070| 20 20 20 20 20 20 20 20 | 62 65 66 6f 72 65 20 64 | |before d|
|00003080| 75 6d 70 69 6e 67 2c 20 | 75 73 65 20 74 68 65 20 |umping, |use the |
|00003090| 64 75 6d 70 20 6f 70 65 | 72 61 74 6f 72 20 20 69 |dump ope|rator i|
|000030a0| 6e 73 74 65 61 64 2e 20 | 20 20 4e 6f 74 65 3a 0d |nstead. | Note:.|
|000030b0| 20 20 20 20 20 20 20 20 | 20 20 61 76 61 69 6c 61 | | availa|
|000030c0| 62 69 6c 69 74 79 20 6f | 66 20 75 6e 64 75 6d 70 |bility o|f undump|
|000030d0| 20 69 73 20 70 6c 61 74 | 66 6f 72 6d 20 73 70 65 | is plat|form spe|
|000030e0| 63 69 66 69 63 20 61 6e | 64 20 6d 61 79 20 6e 6f |cific an|d may no|
|000030f0| 74 0d 20 20 20 20 20 20 | 20 20 20 20 62 65 20 61 |t. | be a|
|00003100| 76 61 69 6c 61 62 6c 65 | 20 66 6f 72 20 61 20 73 |vailable| for a s|
|00003110| 70 65 63 69 66 69 63 20 | 70 6f 72 74 20 6f 66 20 |pecific |port of |
|00003120| 70 65 72 6c 2e 0d 0d 20 | 20 20 20 20 2d 55 20 20 |perl... | -U |
|00003130| 20 61 6c 6c 6f 77 73 20 | 70 65 72 6c 20 74 6f 20 | allows |perl to |
|00003140| 64 6f 20 20 75 6e 73 61 | 66 65 20 20 6f 70 65 72 |do unsa|fe oper|
|00003150| 61 74 69 6f 6e 73 2e 20 | 20 20 43 75 72 72 65 6e |ations. | Curren|
|00003160| 74 6c 79 20 20 74 68 65 | 0d 20 20 20 20 20 20 20 |tly the|. |
|00003170| 20 20 20 6f 6e 6c 79 20 | 20 22 75 6e 73 61 66 65 | only | "unsafe|
|00003180| 22 20 20 6f 70 65 72 61 | 74 69 6f 6e 73 20 20 61 |" opera|tions a|
|00003190| 72 65 20 74 68 65 20 75 | 6e 6c 69 6e 6b 69 6e 67 |re the u|nlinking|
|000031a0| 20 6f 66 20 64 69 72 65 | 63 2d 0d 20 20 20 20 20 | of dire|c-. |
|000031b0| 20 20 20 20 20 74 6f 72 | 69 65 73 20 77 68 69 6c | tor|ies whil|
|000031c0| 65 20 72 75 6e 6e 69 6e | 67 20 61 73 20 73 75 70 |e runnin|g as sup|
|000031d0| 65 72 75 73 65 72 2c 20 | 61 6e 64 20 20 72 75 6e |eruser, |and run|
|000031e0| 6e 69 6e 67 20 20 73 65 | 74 75 69 64 0d 20 20 20 |ning se|tuid. |
|000031f0| 20 20 20 20 20 20 20 70 | 72 6f 67 72 61 6d 73 20 | p|rograms |
|00003200| 77 69 74 68 20 66 61 74 | 61 6c 20 74 61 69 6e 74 |with fat|al taint|
|00003210| 20 63 68 65 63 6b 73 20 | 74 75 72 6e 65 64 20 69 | checks |turned i|
|00003220| 6e 74 6f 20 77 61 72 6e | 69 6e 67 73 2e 0d 0d 20 |nto warn|ings... |
|00003230| 20 20 20 20 2d 76 20 20 | 20 70 72 69 6e 74 73 20 | -v | prints |
|00003240| 74 68 65 20 76 65 72 73 | 69 6f 6e 20 61 6e 64 20 |the vers|ion and |
|00003250| 70 61 74 63 68 6c 65 76 | 65 6c 20 6f 66 20 79 6f |patchlev|el of yo|
|00003260| 75 72 20 70 65 72 6c 20 | 20 65 78 65 63 75 74 2d |ur perl | execut-|
|00003270| 0d 20 20 20 20 20 20 20 | 20 20 20 61 62 6c 65 2e |. | able.|
|00003280| 0d 0d 20 20 20 20 20 2d | 77 20 20 20 70 72 69 6e |.. -|w prin|
|00003290| 74 73 20 77 61 72 6e 69 | 6e 67 73 20 61 62 6f 75 |ts warni|ngs abou|
|000032a0| 74 20 69 64 65 6e 74 69 | 66 69 65 72 73 20 20 74 |t identi|fiers t|
|000032b0| 68 61 74 20 20 61 72 65 | 20 20 6d 65 6e 74 69 6f |hat are| mentio|
|000032c0| 6e 65 64 0d 20 20 20 20 | 20 20 20 20 20 20 6f 6e |ned. | on|
|000032d0| 6c 79 20 20 6f 6e 63 65 | 2c 20 20 61 6e 64 20 20 |ly once|, and |
|000032e0| 73 63 61 6c 61 72 20 76 | 61 72 69 61 62 6c 65 73 |scalar v|ariables|
|000032f0| 20 74 68 61 74 20 61 72 | 65 20 75 73 65 64 20 62 | that ar|e used b|
|00003300| 65 66 6f 72 65 0d 20 20 | 20 20 20 20 20 20 20 20 |efore. | |
|00003310| 62 65 69 6e 67 20 73 65 | 74 2e 20 20 41 6c 73 6f |being se|t. Also|
|00003320| 20 77 61 72 6e 73 20 61 | 62 6f 75 74 20 72 65 64 | warns a|bout red|
|00003330| 65 66 69 6e 65 64 20 73 | 75 62 72 6f 75 74 69 6e |efined s|ubroutin|
|00003340| 65 73 2c 20 61 6e 64 0d | 20 20 20 20 20 20 20 20 |es, and.| |
|00003350| 20 20 72 65 66 65 72 65 | 6e 63 65 73 20 20 74 6f | refere|nces to|
|00003360| 20 20 75 6e 64 65 66 69 | 6e 65 64 20 20 66 69 6c | undefi|ned fil|
|00003370| 65 68 61 6e 64 6c 65 73 | 20 20 6f 72 20 20 66 69 |ehandles| or fi|
|00003380| 6c 65 68 61 6e 64 6c 65 | 73 0d 20 20 20 20 20 20 |lehandle|s. |
|00003390| 20 20 20 20 6f 70 65 6e | 65 64 20 72 65 61 64 6f | open|ed reado|
|000033a0| 6e 6c 79 20 74 68 61 74 | 20 79 6f 75 20 61 72 65 |nly that| you are|
|000033b0| 20 61 74 74 65 6d 70 74 | 69 6e 67 20 20 74 6f 20 | attempt|ing to |
|000033c0| 20 77 72 69 74 65 20 20 | 6f 6e 2e 0d 20 20 20 20 | write |on.. |
|000033d0| 20 20 20 20 20 20 41 6c | 73 6f 20 20 77 61 72 6e | Al|so warn|
|000033e0| 73 20 79 6f 75 20 69 66 | 20 79 6f 75 20 75 73 65 |s you if| you use|
|000033f0| 20 3d 3d 20 6f 6e 20 76 | 61 6c 75 65 73 20 74 68 | == on v|alues th|
|00003400| 61 74 20 64 6f 6e 27 74 | 20 6c 6f 6f 6b 0d 20 20 |at don't| look. |
|00003410| 20 20 20 20 20 20 20 20 | 6c 69 6b 65 20 6e 75 6d | |like num|
|00003420| 62 65 72 73 2c 20 61 6e | 64 20 69 66 20 79 6f 75 |bers, an|d if you|
|00003430| 72 20 73 75 62 72 6f 75 | 74 69 6e 65 73 20 72 65 |r subrou|tines re|
|00003440| 63 75 72 73 65 20 6d 6f | 72 65 20 74 68 61 6e 0d |curse mo|re than.|
|00003450| 20 20 20 20 20 20 20 20 | 20 20 31 30 30 20 64 65 | | 100 de|
|00003460| 65 70 2e 0d 0d 20 20 20 | 20 20 2d 78 64 69 72 65 |ep... | -xdire|
|00003470| 63 74 6f 72 79 0d 20 20 | 20 20 20 20 20 20 20 20 |ctory. | |
|00003480| 74 65 6c 6c 73 20 70 65 | 72 6c 20 74 68 61 74 20 |tells pe|rl that |
|00003490| 74 68 65 20 73 63 72 69 | 70 74 20 69 73 20 65 6d |the scri|pt is em|
|000034a0| 62 65 64 64 65 64 20 20 | 69 6e 20 20 61 20 20 6d |bedded |in a m|
|000034b0| 65 73 73 61 67 65 2e 0d | 20 20 20 20 20 20 20 20 |essage..| |
|000034c0| 20 20 4c 65 61 64 69 6e | 67 20 20 67 61 72 62 61 | Leadin|g garba|
|000034d0| 67 65 20 77 69 6c 6c 20 | 62 65 20 64 69 73 63 61 |ge will |be disca|
|000034e0| 72 64 65 64 20 75 6e 74 | 69 6c 20 74 68 65 20 66 |rded unt|il the f|
|000034f0| 69 72 73 74 20 6c 69 6e | 65 0d 20 20 20 20 20 20 |irst lin|e. |
|00003500| 20 20 20 20 74 68 61 74 | 20 73 74 61 72 74 73 20 | that| starts |
|00003510| 77 69 74 68 20 23 21 20 | 61 6e 64 20 20 63 6f 6e |with #! |and con|
|00003520| 74 61 69 6e 73 20 20 74 | 68 65 20 20 73 74 72 69 |tains t|he stri|
|00003530| 6e 67 20 20 22 70 65 72 | 6c 22 2e 0d 20 20 20 20 |ng "per|l".. |
|00003540| 20 20 20 20 20 20 41 6e | 79 20 20 6d 65 61 6e 69 | An|y meani|
|00003550| 6e 67 66 75 6c 20 20 73 | 77 69 74 63 68 65 73 20 |ngful s|witches |
|00003560| 20 6f 6e 20 74 68 61 74 | 20 6c 69 6e 65 20 77 69 | on that| line wi|
|00003570| 6c 6c 20 62 65 20 61 70 | 70 6c 69 65 64 0d 20 20 |ll be ap|plied. |
|00003580| 20 20 20 20 20 20 20 20 | 28 62 75 74 20 6f 6e 6c | |(but onl|
|00003590| 79 20 6f 6e 65 20 67 72 | 6f 75 70 20 6f 66 20 73 |y one gr|oup of s|
|000035a0| 77 69 74 63 68 65 73 2c | 20 61 73 20 77 69 74 68 |witches,| as with|
|000035b0| 20 6e 6f 72 6d 61 6c 20 | 23 21 20 70 72 6f 2d 0d | normal |#! pro-.|
|000035c0| 20 20 20 20 20 20 20 20 | 20 20 63 65 73 73 69 6e | | cessin|
|000035d0| 67 29 2e 20 20 20 49 66 | 20 61 20 64 69 72 65 63 |g). If| a direc|
|000035e0| 74 6f 72 79 20 6e 61 6d | 65 20 69 73 20 73 70 65 |tory nam|e is spe|
|000035f0| 63 69 66 69 65 64 2c 20 | 50 65 72 6c 20 77 69 6c |cified, |Perl wil|
|00003600| 6c 0d 20 20 20 20 20 20 | 20 20 20 20 73 77 69 74 |l. | swit|
|00003610| 63 68 20 74 6f 20 74 68 | 61 74 20 64 69 72 65 63 |ch to th|at direc|
|00003620| 74 6f 72 79 20 20 62 65 | 66 6f 72 65 20 20 72 75 |tory be|fore ru|
|00003630| 6e 6e 69 6e 67 20 20 74 | 68 65 20 20 73 63 72 69 |nning t|he scri|
|00003640| 70 74 2e 0d 20 20 20 20 | 20 20 20 20 20 20 54 68 |pt.. | Th|
|00003650| 65 20 2d 78 20 73 77 69 | 74 63 68 20 6f 6e 6c 79 |e -x swi|tch only|
|00003660| 20 63 6f 6e 74 72 6f 6c | 73 20 74 68 65 20 74 68 | control|s the th|
|00003670| 65 20 64 69 73 70 6f 73 | 61 6c 20 6f 66 20 6c 65 |e dispos|al of le|
|00003680| 61 64 69 6e 67 0d 20 20 | 20 20 20 20 20 20 20 20 |ading. | |
|00003690| 67 61 72 62 61 67 65 2e | 20 20 54 68 65 20 73 63 |garbage.| The sc|
|000036a0| 72 69 70 74 20 6d 75 73 | 74 20 62 65 20 74 65 72 |ript mus|t be ter|
|000036b0| 6d 69 6e 61 74 65 64 20 | 77 69 74 68 20 5f 5f 45 |minated |with __E|
|000036c0| 4e 44 5f 5f 20 69 66 0d | 20 20 20 20 20 20 20 20 |ND__ if.| |
|000036d0| 20 20 74 68 65 72 65 20 | 69 73 20 74 72 61 69 6c | there |is trail|
|000036e0| 69 6e 67 20 67 61 72 62 | 61 67 65 20 74 6f 20 62 |ing garb|age to b|
|000036f0| 65 20 69 67 6e 6f 72 65 | 64 20 28 74 68 65 20 73 |e ignore|d (the s|
|00003700| 63 72 69 70 74 20 63 61 | 6e 0d 20 20 20 20 20 20 |cript ca|n. |
|00003710| 20 20 20 20 70 72 6f 63 | 65 73 73 20 61 6e 79 20 | proc|ess any |
|00003720| 6f 72 20 61 6c 6c 20 6f | 66 20 74 68 65 20 74 72 |or all o|f the tr|
|00003730| 61 69 6c 69 6e 67 20 67 | 61 72 62 61 67 65 20 76 |ailing g|arbage v|
|00003740| 69 61 20 74 68 65 20 44 | 41 54 41 0d 20 20 20 20 |ia the D|ATA. |
|00003750| 20 20 20 20 20 20 66 69 | 6c 65 68 61 6e 64 6c 65 | fi|lehandle|
|00003760| 20 69 66 20 64 65 73 69 | 72 65 64 29 2e 0d 0d 20 | if desi|red)... |
|00003770| 20 20 20 20 44 61 74 61 | 20 54 79 70 65 73 20 61 | Data| Types a|
|00003780| 6e 64 20 4f 62 6a 65 63 | 74 73 0d 0d 20 20 20 20 |nd Objec|ts.. |
|00003790| 20 50 65 72 6c 20 68 61 | 73 20 74 68 72 65 65 20 | Perl ha|s three |
|000037a0| 64 61 74 61 20 74 79 70 | 65 73 3a 20 73 63 61 6c |data typ|es: scal|
|000037b0| 61 72 73 2c 20 61 72 72 | 61 79 73 20 6f 66 20 20 |ars, arr|ays of |
|000037c0| 73 63 61 6c 61 72 73 2c | 20 20 61 6e 64 0d 20 20 |scalars,| and. |
|000037d0| 20 20 20 61 73 73 6f 63 | 69 61 74 69 76 65 20 61 | assoc|iative a|
|000037e0| 72 72 61 79 73 20 6f 66 | 20 73 63 61 6c 61 72 73 |rrays of| scalars|
|000037f0| 2e 20 20 4e 6f 72 6d 61 | 6c 20 61 72 72 61 79 73 |. Norma|l arrays|
|00003800| 20 61 72 65 20 69 6e 64 | 65 78 65 64 20 62 79 0d | are ind|exed by.|
|00003810| 20 20 20 20 20 6e 75 6d | 62 65 72 2c 20 61 6e 64 | num|ber, and|
|00003820| 20 61 73 73 6f 63 69 61 | 74 69 76 65 20 61 72 72 | associa|tive arr|
|00003830| 61 79 73 20 62 79 20 73 | 74 72 69 6e 67 2e 0d 0d |ays by s|tring...|
|00003840| 20 20 20 20 20 54 68 65 | 20 69 6e 74 65 72 70 72 | The| interpr|
|00003850| 65 74 61 74 69 6f 6e 20 | 6f 66 20 6f 70 65 72 61 |etation |of opera|
|00003860| 74 69 6f 6e 73 20 61 6e | 64 20 76 61 6c 75 65 73 |tions an|d values|
|00003870| 20 20 69 6e 20 20 70 65 | 72 6c 20 20 73 6f 6d 65 | in pe|rl some|
|00003880| 2d 0d 20 20 20 20 20 74 | 69 6d 65 73 20 20 64 65 |-. t|imes de|
|00003890| 70 65 6e 64 73 20 6f 6e | 20 74 68 65 20 72 65 71 |pends on| the req|
|000038a0| 75 69 72 65 6d 65 6e 74 | 73 20 6f 66 20 74 68 65 |uirement|s of the|
|000038b0| 20 63 6f 6e 74 65 78 74 | 20 61 72 6f 75 6e 64 20 | context| around |
|000038c0| 74 68 65 0d 20 20 20 20 | 20 6f 70 65 72 61 74 69 |the. | operati|
|000038d0| 6f 6e 20 6f 72 20 76 61 | 6c 75 65 2e 20 20 54 68 |on or va|lue. Th|
|000038e0| 65 72 65 20 61 72 65 20 | 74 68 72 65 65 20 6d 61 |ere are |three ma|
|000038f0| 6a 6f 72 20 63 6f 6e 74 | 65 78 74 73 3a 20 73 74 |jor cont|exts: st|
|00003900| 72 69 6e 67 2c 0d 20 20 | 20 20 20 6e 75 6d 65 72 |ring,. | numer|
|00003910| 69 63 20 20 61 6e 64 20 | 20 61 72 72 61 79 2e 20 |ic and | array. |
|00003920| 20 43 65 72 74 61 69 6e | 20 6f 70 65 72 61 74 69 | Certain| operati|
|00003930| 6f 6e 73 20 72 65 74 75 | 72 6e 20 61 72 72 61 79 |ons retu|rn array|
|00003940| 20 76 61 6c 75 65 73 0d | 20 20 20 20 20 69 6e 20 | values.| in |
|00003950| 63 6f 6e 74 65 78 74 73 | 20 77 61 6e 74 69 6e 67 |contexts| wanting|
|00003960| 20 61 6e 20 61 72 72 61 | 79 2c 20 61 6e 64 20 73 | an arra|y, and s|
|00003970| 63 61 6c 61 72 20 20 76 | 61 6c 75 65 73 20 20 6f |calar v|alues o|
|00003980| 74 68 65 72 77 69 73 65 | 2e 0d 20 20 20 20 20 28 |therwise|.. (|
|00003990| 49 66 20 74 68 69 73 20 | 69 73 20 74 72 75 65 20 |If this |is true |
|000039a0| 6f 66 20 61 6e 20 6f 70 | 65 72 61 74 69 6f 6e 20 |of an op|eration |
|000039b0| 69 74 20 77 69 6c 6c 20 | 62 65 20 6d 65 6e 74 69 |it will |be menti|
|000039c0| 6f 6e 65 64 20 69 6e 20 | 74 68 65 0d 20 20 20 20 |oned in |the. |
|000039d0| 20 64 6f 63 75 6d 65 6e | 74 61 74 69 6f 6e 20 66 | documen|tation f|
|000039e0| 6f 72 20 74 68 61 74 20 | 6f 70 65 72 61 74 69 6f |or that |operatio|
|000039f0| 6e 2e 29 20 4f 70 65 72 | 61 74 69 6f 6e 73 20 20 |n.) Oper|ations |
|00003a00| 77 68 69 63 68 20 20 72 | 65 74 75 72 6e 0d 20 20 |which r|eturn. |
|00003a10| 20 20 20 73 63 61 6c 61 | 72 73 20 20 64 6f 6e 27 | scala|rs don'|
|00003a20| 74 20 20 63 61 72 65 20 | 20 77 68 65 74 68 65 72 |t care | whether|
|00003a30| 20 20 74 68 65 20 20 63 | 6f 6e 74 65 78 74 20 69 | the c|ontext i|
|00003a40| 73 20 6c 6f 6f 6b 69 6e | 67 20 66 6f 72 20 61 0d |s lookin|g for a.|
|00003a50| 20 20 20 20 20 73 74 72 | 69 6e 67 20 6f 72 20 61 | str|ing or a|
|00003a60| 20 6e 75 6d 62 65 72 2c | 20 62 75 74 20 20 73 63 | number,| but sc|
|00003a70| 61 6c 61 72 20 20 76 61 | 72 69 61 62 6c 65 73 20 |alar va|riables |
|00003a80| 20 61 6e 64 20 20 76 61 | 6c 75 65 73 20 20 61 72 | and va|lues ar|
|00003a90| 65 0d 20 20 20 20 20 69 | 6e 74 65 72 70 72 65 74 |e. i|nterpret|
|00003aa0| 65 64 20 61 73 20 73 74 | 72 69 6e 67 73 20 6f 72 |ed as st|rings or|
|00003ab0| 20 6e 75 6d 62 65 72 73 | 20 61 73 20 61 70 70 72 | numbers| as appr|
|00003ac0| 6f 70 72 69 61 74 65 20 | 74 6f 20 74 68 65 20 63 |opriate |to the c|
|00003ad0| 6f 6e 2d 0d 20 20 20 20 | 20 74 65 78 74 2e 20 20 |on-. | text. |
|00003ae0| 41 20 73 63 61 6c 61 72 | 20 69 73 20 69 6e 74 65 |A scalar| is inte|
|00003af0| 72 70 72 65 74 65 64 20 | 61 73 20 54 52 55 45 20 |rpreted |as TRUE |
|00003b00| 69 6e 20 74 68 65 20 62 | 6f 6f 6c 65 61 6e 20 20 |in the b|oolean |
|00003b10| 73 65 6e 73 65 0d 20 20 | 20 20 20 69 66 20 20 69 |sense. | if i|
|00003b20| 74 20 20 69 73 20 20 6e | 6f 74 20 20 74 68 65 20 |t is n|ot the |
|00003b30| 6e 75 6c 6c 20 73 74 72 | 69 6e 67 20 6f 72 20 30 |null str|ing or 0|
|00003b40| 2e 20 20 42 6f 6f 6c 65 | 61 6e 73 20 72 65 74 75 |. Boole|ans retu|
|00003b50| 72 6e 65 64 20 62 79 0d | 20 20 20 20 20 6f 70 65 |rned by.| ope|
|00003b60| 72 61 74 6f 72 73 20 61 | 72 65 20 31 20 66 6f 72 |rators a|re 1 for|
|00003b70| 20 74 72 75 65 20 61 6e | 64 20 30 20 6f 72 20 27 | true an|d 0 or '|
|00003b80| 27 20 28 74 68 65 20 6e | 75 6c 6c 20 20 73 74 72 |' (the n|ull str|
|00003b90| 69 6e 67 29 20 20 66 6f | 72 0d 20 20 20 20 20 66 |ing) fo|r. f|
|00003ba0| 61 6c 73 65 2e 0d 0d 20 | 20 20 20 20 54 68 65 72 |alse... | Ther|
|00003bb0| 65 20 61 72 65 20 61 63 | 74 75 61 6c 6c 79 20 74 |e are ac|tually t|
|00003bc0| 77 6f 20 76 61 72 69 65 | 74 69 65 73 20 6f 66 20 |wo varie|ties of |
|00003bd0| 6e 75 6c 6c 20 73 74 72 | 69 6e 67 3a 20 64 65 66 |null str|ing: def|
|00003be0| 69 6e 65 64 20 61 6e 64 | 0d 20 20 20 20 20 75 6e |ined and|. un|
|00003bf0| 64 65 66 69 6e 65 64 2e | 20 20 20 55 6e 64 65 66 |defined.| Undef|
|00003c00| 69 6e 65 64 20 20 6e 75 | 6c 6c 20 73 74 72 69 6e |ined nu|ll strin|
|00003c10| 67 73 20 61 72 65 20 72 | 65 74 75 72 6e 65 64 20 |gs are r|eturned |
|00003c20| 77 68 65 6e 20 74 68 65 | 72 65 0d 20 20 20 20 20 |when the|re. |
|00003c30| 69 73 20 6e 6f 20 72 65 | 61 6c 20 76 61 6c 75 65 |is no re|al value|
|00003c40| 20 66 6f 72 20 73 6f 6d | 65 74 68 69 6e 67 2c 20 | for som|ething, |
|00003c50| 73 75 63 68 20 61 73 20 | 77 68 65 6e 20 20 74 68 |such as |when th|
|00003c60| 65 72 65 20 20 77 61 73 | 20 20 61 6e 0d 20 20 20 |ere was| an. |
|00003c70| 20 20 65 72 72 6f 72 2c | 20 6f 72 20 61 74 20 65 | error,| or at e|
|00003c80| 6e 64 20 6f 66 20 66 69 | 6c 65 2c 20 6f 72 20 77 |nd of fi|le, or w|
|00003c90| 68 65 6e 20 79 6f 75 20 | 72 65 66 65 72 20 74 6f |hen you |refer to|
|00003ca0| 20 61 6e 20 75 6e 69 6e | 69 74 69 61 6c 2d 0d 20 | an unin|itial-. |
|00003cb0| 20 20 20 20 69 7a 65 64 | 20 76 61 72 69 61 62 6c | ized| variabl|
|00003cc0| 65 20 6f 72 20 65 6c 65 | 6d 65 6e 74 20 6f 66 20 |e or ele|ment of |
|00003cd0| 61 6e 20 20 61 72 72 61 | 79 2e 20 20 20 41 6e 20 |an arra|y. An |
|00003ce0| 20 75 6e 64 65 66 69 6e | 65 64 20 20 6e 75 6c 6c | undefin|ed null|
|00003cf0| 0d 20 20 20 20 20 73 74 | 72 69 6e 67 20 20 6d 61 |. st|ring ma|
|00003d00| 79 20 62 65 63 6f 6d 65 | 20 64 65 66 69 6e 65 64 |y become| defined|
|00003d10| 20 74 68 65 20 66 69 72 | 73 74 20 74 69 6d 65 20 | the fir|st time |
|00003d20| 79 6f 75 20 61 63 63 65 | 73 73 20 69 74 2c 20 62 |you acce|ss it, b|
|00003d30| 75 74 0d 20 20 20 20 20 | 70 72 69 6f 72 20 74 6f |ut. |prior to|
|00003d40| 20 74 68 61 74 20 79 6f | 75 20 63 61 6e 20 75 73 | that yo|u can us|
|00003d50| 65 20 74 68 65 20 64 65 | 66 69 6e 65 64 28 29 20 |e the de|fined() |
|00003d60| 6f 70 65 72 61 74 6f 72 | 20 20 74 6f 20 20 64 65 |operator| to de|
|00003d70| 74 65 72 2d 0d 20 20 20 | 20 20 6d 69 6e 65 20 77 |ter-. | mine w|
|00003d80| 68 65 74 68 65 72 20 74 | 68 65 20 76 61 6c 75 65 |hether t|he value|
|00003d90| 20 69 73 20 64 65 66 69 | 6e 65 64 20 6f 72 20 6e | is defi|ned or n|
|00003da0| 6f 74 2e 0d 0d 20 20 20 | 20 20 52 65 66 65 72 65 |ot... | Refere|
|00003db0| 6e 63 65 73 20 74 6f 20 | 73 63 61 6c 61 72 20 76 |nces to |scalar v|
|00003dc0| 61 72 69 61 62 6c 65 73 | 20 61 6c 77 61 79 73 20 |ariables| always |
|00003dd0| 62 65 67 69 6e 20 77 69 | 74 68 20 20 27 24 27 2c |begin wi|th '$',|
|00003de0| 20 20 65 76 65 6e 0d 20 | 20 20 20 20 77 68 65 6e | even. | when|
|00003df0| 20 72 65 66 65 72 72 69 | 6e 67 20 74 6f 20 61 20 | referri|ng to a |
|00003e00| 73 63 61 6c 61 72 20 74 | 68 61 74 20 69 73 20 70 |scalar t|hat is p|
|00003e10| 61 72 74 20 6f 66 20 61 | 6e 20 61 72 72 61 79 2e |art of a|n array.|
|00003e20| 20 20 54 68 75 73 3a 0d | 0d 20 20 20 20 20 20 20 | Thus:.|. |
|00003e30| 20 20 24 64 61 79 73 20 | 20 20 20 20 20 20 20 20 | $days | |
|00003e40| 20 20 23 20 61 20 73 69 | 6d 70 6c 65 20 73 63 61 | # a si|mple sca|
|00003e50| 6c 61 72 20 76 61 72 69 | 61 62 6c 65 0d 20 20 20 |lar vari|able. |
|00003e60| 20 20 20 20 20 20 24 64 | 61 79 73 5b 32 38 5d 20 | $d|ays[28] |
|00003e70| 20 20 20 20 20 20 23 20 | 32 39 74 68 20 65 6c 65 | # |29th ele|
|00003e80| 6d 65 6e 74 20 6f 66 20 | 61 72 72 61 79 20 40 64 |ment of |array @d|
|00003e90| 61 79 73 0d 20 20 20 20 | 20 20 20 20 20 24 64 61 |ays. | $da|
|00003ea0| 79 73 7b 27 46 65 62 27 | 7d 20 20 20 20 23 20 6f |ys{'Feb'|} # o|
|00003eb0| 6e 65 20 76 61 6c 75 65 | 20 66 72 6f 6d 20 61 6e |ne value| from an|
|00003ec0| 20 61 73 73 6f 63 69 61 | 74 69 76 65 20 61 72 72 | associa|tive arr|
|00003ed0| 61 79 0d 20 20 20 20 20 | 20 20 20 20 24 23 64 61 |ay. | $#da|
|00003ee0| 79 73 20 20 20 20 20 20 | 20 20 20 20 23 20 6c 61 |ys | # la|
|00003ef0| 73 74 20 69 6e 64 65 78 | 20 6f 66 20 61 72 72 61 |st index| of arra|
|00003f00| 79 20 40 64 61 79 73 0d | 0d 20 20 20 20 20 62 75 |y @days.|. bu|
|00003f10| 74 20 65 6e 74 69 72 65 | 20 61 72 72 61 79 73 20 |t entire| arrays |
|00003f20| 6f 72 20 61 72 72 61 79 | 20 73 6c 69 63 65 73 20 |or array| slices |
|00003f30| 61 72 65 20 64 65 6e 6f | 74 65 64 20 62 79 20 27 |are deno|ted by '|
|00003f40| 40 27 3a 0d 0d 20 20 20 | 20 20 20 20 20 20 40 64 |@':.. | @d|
|00003f50| 61 79 73 20 20 20 20 20 | 20 20 20 20 20 20 23 20 |ays | # |
|00003f60| 28 24 64 61 79 73 5b 30 | 5d 2c 20 24 64 61 79 73 |($days[0|], $days|
|00003f70| 5b 31 5d 2c 2e 2e 2e 20 | 24 64 61 79 73 5b 6e 5d |[1],... |$days[n]|
|00003f80| 29 0d 20 20 20 20 20 20 | 20 20 20 40 64 61 79 73 |). | @days|
|00003f90| 5b 33 2c 34 2c 35 5d 20 | 20 20 20 23 20 73 61 6d |[3,4,5] | # sam|
|00003fa0| 65 20 61 73 20 40 64 61 | 79 73 5b 33 2e 2e 35 5d |e as @da|ys[3..5]|
|00003fb0| 0d 20 20 20 20 20 20 20 | 20 20 40 64 61 79 73 7b |. | @days{|
|00003fc0| 27 61 27 2c 27 63 27 7d | 20 20 23 20 73 61 6d 65 |'a','c'}| # same|
|00003fd0| 20 61 73 20 28 24 64 61 | 79 73 7b 27 61 27 7d 2c | as ($da|ys{'a'},|
|00003fe0| 24 64 61 79 73 7b 27 63 | 27 7d 29 0d 0d 20 20 20 |$days{'c|'}).. |
|00003ff0| 20 20 61 6e 64 20 65 6e | 74 69 72 65 20 61 73 73 | and en|tire ass|
|00004000| 6f 63 69 61 74 69 76 65 | 20 61 72 72 61 79 73 20 |ociative| arrays |
|00004010| 61 72 65 20 64 65 6e 6f | 74 65 64 20 62 79 20 27 |are deno|ted by '|
|00004020| 25 27 3a 0d 0d 20 20 20 | 20 20 20 20 20 20 25 64 |%':.. | %d|
|00004030| 61 79 73 20 20 20 20 20 | 20 20 20 20 20 20 23 20 |ays | # |
|00004040| 28 6b 65 79 31 2c 20 76 | 61 6c 31 2c 20 6b 65 79 |(key1, v|al1, key|
|00004050| 32 2c 20 76 61 6c 32 20 | 2e 2e 2e 29 0d 0d 20 20 |2, val2 |...).. |
|00004060| 20 20 20 41 6e 79 20 6f | 66 20 74 68 65 73 65 20 | Any o|f these |
|00004070| 65 69 67 68 74 20 63 6f | 6e 73 74 72 75 63 74 73 |eight co|nstructs|
|00004080| 20 6d 61 79 20 73 65 72 | 76 65 20 61 73 20 61 6e | may ser|ve as an|
|00004090| 20 20 6c 76 61 6c 75 65 | 2c 20 20 74 68 61 74 0d | lvalue|, that.|
|000040a0| 20 20 20 20 20 69 73 2c | 20 20 6d 61 79 20 62 65 | is,| may be|
|000040b0| 20 61 73 73 69 67 6e 65 | 64 20 74 6f 2e 20 20 28 | assigne|d to. (|
|000040c0| 49 74 20 61 6c 73 6f 20 | 74 75 72 6e 73 20 6f 75 |It also |turns ou|
|000040d0| 74 20 74 68 61 74 20 61 | 6e 20 61 73 73 69 67 6e |t that a|n assign|
|000040e0| 2d 0d 20 20 20 20 20 6d | 65 6e 74 20 69 73 20 69 |-. m|ent is i|
|000040f0| 74 73 65 6c 66 20 61 6e | 20 6c 76 61 6c 75 65 20 |tself an| lvalue |
|00004100| 69 6e 20 63 65 72 74 61 | 69 6e 20 20 63 6f 6e 74 |in certa|in cont|
|00004110| 65 78 74 73 2d 2d 73 65 | 65 20 20 65 78 61 6d 70 |exts--se|e examp|
|00004120| 6c 65 73 0d 20 20 20 20 | 20 75 6e 64 65 72 20 20 |les. | under |
|00004130| 73 2c 20 74 72 20 61 6e | 64 20 63 68 6f 70 2e 29 |s, tr an|d chop.)|
|00004140| 20 41 73 73 69 67 6e 6d | 65 6e 74 20 74 6f 20 61 | Assignm|ent to a|
|00004150| 20 73 63 61 6c 61 72 20 | 65 76 61 6c 75 61 74 65 | scalar |evaluate|
|00004160| 73 20 74 68 65 0d 20 20 | 20 20 20 72 69 67 68 74 |s the. | right|
|00004170| 68 61 6e 64 20 73 69 64 | 65 20 69 6e 20 61 20 73 |hand sid|e in a s|
|00004180| 63 61 6c 61 72 20 63 6f | 6e 74 65 78 74 2c 20 77 |calar co|ntext, w|
|00004190| 68 69 6c 65 20 61 73 73 | 69 67 6e 6d 65 6e 74 20 |hile ass|ignment |
|000041a0| 20 74 6f 20 20 61 6e 0d | 20 20 20 20 20 61 72 72 | to an.| arr|
|000041b0| 61 79 20 20 6f 72 20 20 | 61 72 72 61 79 20 20 73 |ay or |array s|
|000041c0| 6c 69 63 65 20 20 65 76 | 61 6c 75 61 74 65 73 20 |lice ev|aluates |
|000041d0| 20 74 68 65 20 72 69 67 | 68 74 68 61 6e 64 20 73 | the rig|hthand s|
|000041e0| 69 64 65 20 69 6e 20 61 | 6e 0d 20 20 20 20 20 61 |ide in a|n. a|
|000041f0| 72 72 61 79 20 63 6f 6e | 74 65 78 74 2e 0d 0d 20 |rray con|text... |
|00004200| 20 20 20 20 59 6f 75 20 | 6d 61 79 20 20 66 69 6e | You |may fin|
|00004210| 64 20 20 74 68 65 20 20 | 6c 65 6e 67 74 68 20 20 |d the |length |
|00004220| 6f 66 20 20 61 72 72 61 | 79 20 20 40 64 61 79 73 |of arra|y @days|
|00004230| 20 20 62 79 20 20 65 76 | 61 6c 75 61 74 69 6e 67 | by ev|aluating|
|00004240| 0d 20 20 20 20 20 22 24 | 23 64 61 79 73 22 2c 20 |. "$|#days", |
|00004250| 20 61 73 20 69 6e 20 63 | 73 68 2e 20 20 28 41 63 | as in c|sh. (Ac|
|00004260| 74 75 61 6c 6c 79 2c 20 | 69 74 27 73 20 6e 6f 74 |tually, |it's not|
|00004270| 20 74 68 65 20 6c 65 6e | 67 74 68 20 6f 66 20 74 | the len|gth of t|
|00004280| 68 65 0d 20 20 20 20 20 | 61 72 72 61 79 2c 20 69 |he. |array, i|
|00004290| 74 27 73 20 74 68 65 20 | 73 75 62 73 63 72 69 70 |t's the |subscrip|
|000042a0| 74 20 6f 66 20 74 68 65 | 20 6c 61 73 74 20 65 6c |t of the| last el|
|000042b0| 65 6d 65 6e 74 2c 20 20 | 73 69 6e 63 65 20 20 74 |ement, |since t|
|000042c0| 68 65 72 65 0d 20 20 20 | 20 20 69 73 20 20 28 6f |here. | is (o|
|000042d0| 72 64 69 6e 61 72 69 6c | 79 29 20 61 20 30 74 68 |rdinaril|y) a 0th|
|000042e0| 20 65 6c 65 6d 65 6e 74 | 2e 29 20 41 73 73 69 67 | element|.) Assig|
|000042f0| 6e 69 6e 67 20 74 6f 20 | 24 23 64 61 79 73 20 63 |ning to |$#days c|
|00004300| 68 61 6e 67 65 73 0d 20 | 20 20 20 20 74 68 65 20 |hanges. | the |
|00004310| 6c 65 6e 67 74 68 20 6f | 66 20 74 68 65 20 61 72 |length o|f the ar|
|00004320| 72 61 79 2e 20 20 53 68 | 6f 72 74 65 6e 69 6e 67 |ray. Sh|ortening|
|00004330| 20 61 6e 20 61 72 72 61 | 79 20 62 79 20 74 68 69 | an arra|y by thi|
|00004340| 73 20 6d 65 74 68 6f 64 | 0d 20 20 20 20 20 64 6f |s method|. do|
|00004350| 65 73 20 20 6e 6f 74 20 | 61 63 74 75 61 6c 6c 79 |es not |actually|
|00004360| 20 64 65 73 74 72 6f 79 | 20 61 6e 79 20 76 61 6c | destroy| any val|
|00004370| 75 65 73 2e 20 20 4c 65 | 6e 67 74 68 65 6e 69 6e |ues. Le|ngthenin|
|00004380| 67 20 61 6e 20 61 72 72 | 61 79 0d 20 20 20 20 20 |g an arr|ay. |
|00004390| 74 68 61 74 20 77 61 73 | 20 70 72 65 76 69 6f 75 |that was| previou|
|000043a0| 73 6c 79 20 73 68 6f 72 | 74 65 6e 65 64 20 72 65 |sly shor|tened re|
|000043b0| 63 6f 76 65 72 73 20 74 | 68 65 20 76 61 6c 75 65 |covers t|he value|
|000043c0| 73 20 74 68 61 74 20 20 | 77 65 72 65 0d 20 20 20 |s that |were. |
|000043d0| 20 20 69 6e 20 20 74 68 | 6f 73 65 20 65 6c 65 6d | in th|ose elem|
|000043e0| 65 6e 74 73 2e 20 20 59 | 6f 75 20 63 61 6e 20 61 |ents. Y|ou can a|
|000043f0| 6c 73 6f 20 67 61 69 6e | 20 73 6f 6d 65 20 6d 65 |lso gain| some me|
|00004400| 61 73 75 72 65 20 6f 66 | 20 65 66 66 69 2d 0d 20 |asure of| effi-. |
|00004410| 20 20 20 20 63 69 65 6e | 63 79 20 62 79 20 70 72 | cien|cy by pr|
|00004420| 65 65 78 74 65 6e 64 69 | 6e 67 20 61 6e 20 61 72 |eextendi|ng an ar|
|00004430| 72 61 79 20 74 68 61 74 | 20 69 73 20 67 6f 69 6e |ray that| is goin|
|00004440| 67 20 20 74 6f 20 20 67 | 65 74 20 20 62 69 67 2e |g to g|et big.|
|00004450| 0d 20 20 20 20 20 28 59 | 6f 75 20 20 63 61 6e 20 |. (Y|ou can |
|00004460| 20 61 6c 73 6f 20 20 65 | 78 74 65 6e 64 20 20 61 | also e|xtend a|
|00004470| 6e 20 61 72 72 61 79 20 | 62 79 20 61 73 73 69 67 |n array |by assig|
|00004480| 6e 69 6e 67 20 74 6f 20 | 61 6e 20 65 6c 65 6d 65 |ning to |an eleme|
|00004490| 6e 74 0d 20 20 20 20 20 | 74 68 61 74 20 69 73 20 |nt. |that is |
|000044a0| 6f 66 66 20 74 68 65 20 | 65 6e 64 20 6f 66 20 74 |off the |end of t|
|000044b0| 68 65 20 61 72 72 61 79 | 2e 20 20 54 68 69 73 20 |he array|. This |
|000044c0| 64 69 66 66 65 72 73 20 | 66 72 6f 6d 20 61 73 73 |differs |from ass|
|000044d0| 69 67 6e 2d 0d 20 20 20 | 20 20 69 6e 67 20 74 6f |ign-. | ing to|
|000044e0| 20 24 23 77 68 61 74 65 | 76 65 72 20 69 6e 20 74 | $#whate|ver in t|
|000044f0| 68 61 74 20 69 6e 74 65 | 72 76 65 6e 69 6e 67 20 |hat inte|rvening |
|00004500| 76 61 6c 75 65 73 20 61 | 72 65 20 73 65 74 20 74 |values a|re set t|
|00004510| 6f 20 6e 75 6c 6c 0d 20 | 20 20 20 20 72 61 74 68 |o null. | rath|
|00004520| 65 72 20 74 68 61 6e 20 | 72 65 63 6f 76 65 72 65 |er than |recovere|
|00004530| 64 2e 29 20 59 6f 75 20 | 63 61 6e 20 74 72 75 6e |d.) You |can trun|
|00004540| 63 61 74 65 20 61 6e 20 | 20 61 72 72 61 79 20 20 |cate an | array |
|00004550| 64 6f 77 6e 20 20 74 6f | 0d 20 20 20 20 20 6e 6f |down to|. no|
|00004560| 74 68 69 6e 67 20 20 62 | 79 20 61 73 73 69 67 6e |thing b|y assign|
|00004570| 69 6e 67 20 74 68 65 20 | 6e 75 6c 6c 20 6c 69 73 |ing the |null lis|
|00004580| 74 20 28 29 20 74 6f 20 | 69 74 2e 20 20 54 68 65 |t () to |it. The|
|00004590| 20 66 6f 6c 6c 6f 77 69 | 6e 67 0d 20 20 20 20 20 | followi|ng. |
|000045a0| 61 72 65 20 65 78 61 63 | 74 6c 79 20 65 71 75 69 |are exac|tly equi|
|000045b0| 76 61 6c 65 6e 74 0d 0d | 20 20 20 20 20 20 20 20 |valent..| |
|000045c0| 20 20 40 77 68 61 74 65 | 76 65 72 20 3d 20 28 29 | @whate|ver = ()|
|000045d0| 3b 0d 20 20 20 20 20 20 | 20 20 20 20 24 23 77 68 |;. | $#wh|
|000045e0| 61 74 65 76 65 72 20 3d | 20 24 5b 20 2d 20 31 3b |atever =| $[ - 1;|
|000045f0| 0d 0d 20 20 20 20 20 49 | 66 20 79 6f 75 20 65 76 |.. I|f you ev|
|00004600| 61 6c 75 61 74 65 20 61 | 6e 20 61 72 72 61 79 20 |aluate a|n array |
|00004610| 69 6e 20 61 20 73 63 61 | 6c 61 72 20 63 6f 6e 74 |in a sca|lar cont|
|00004620| 65 78 74 2c 20 69 74 20 | 72 65 74 75 72 6e 73 20 |ext, it |returns |
|00004630| 74 68 65 0d 20 20 20 20 | 20 6c 65 6e 67 74 68 20 |the. | length |
|00004640| 6f 66 20 74 68 65 20 61 | 72 72 61 79 2e 20 20 54 |of the a|rray. T|
|00004650| 68 65 20 66 6f 6c 6c 6f | 77 69 6e 67 20 69 73 20 |he follo|wing is |
|00004660| 61 6c 77 61 79 73 20 74 | 72 75 65 3a 0d 0d 20 20 |always t|rue:.. |
|00004670| 20 20 20 20 20 20 20 20 | 73 63 61 6c 61 72 28 40 | |scalar(@|
|00004680| 77 68 61 74 65 76 65 72 | 29 20 3d 3d 20 24 23 77 |whatever|) == $#w|
|00004690| 68 61 74 65 76 65 72 20 | 2d 20 24 5b 20 2b 20 31 |hatever |- $[ + 1|
|000046a0| 3b 0d 0d 20 20 20 20 20 | 49 66 20 79 6f 75 20 65 |;.. |If you e|
|000046b0| 76 61 6c 75 61 74 65 20 | 61 6e 20 61 73 73 6f 63 |valuate |an assoc|
|000046c0| 69 61 74 69 76 65 20 61 | 72 72 61 79 20 69 6e 20 |iative a|rray in |
|000046d0| 61 20 73 63 61 6c 61 72 | 20 63 6f 6e 74 65 78 74 |a scalar| context|
|000046e0| 2c 20 69 74 0d 20 20 20 | 20 20 72 65 74 75 72 6e |, it. | return|
|000046f0| 73 20 20 61 20 76 61 6c | 75 65 20 77 68 69 63 68 |s a val|ue which|
|00004700| 20 69 73 20 74 72 75 65 | 20 69 66 20 61 6e 64 20 | is true| if and |
|00004710| 6f 6e 6c 79 20 69 66 20 | 74 68 65 20 61 72 72 61 |only if |the arra|
|00004720| 79 20 63 6f 6e 2d 0d 20 | 20 20 20 20 74 61 69 6e |y con-. | tain|
|00004730| 73 20 61 6e 79 20 65 6c | 65 6d 65 6e 74 73 2e 20 |s any el|ements. |
|00004740| 20 28 49 66 20 74 68 65 | 72 65 20 61 72 65 20 61 | (If the|re are a|
|00004750| 6e 79 20 65 6c 65 6d 65 | 6e 74 73 2c 20 20 74 68 |ny eleme|nts, th|
|00004760| 65 20 20 76 61 6c 75 65 | 0d 20 20 20 20 20 72 65 |e value|. re|
|00004770| 74 75 72 6e 65 64 20 20 | 69 73 20 61 20 73 74 72 |turned |is a str|
|00004780| 69 6e 67 20 63 6f 6e 73 | 69 73 74 69 6e 67 20 6f |ing cons|isting o|
|00004790| 66 20 74 68 65 20 6e 75 | 6d 62 65 72 20 6f 66 20 |f the nu|mber of |
|000047a0| 75 73 65 64 20 62 75 63 | 6b 2d 0d 20 20 20 20 20 |used buc|k-. |
|000047b0| 65 74 73 20 61 6e 64 20 | 74 68 65 20 6e 75 6d 62 |ets and |the numb|
|000047c0| 65 72 20 6f 66 20 20 61 | 6c 6c 6f 63 61 74 65 64 |er of a|llocated|
|000047d0| 20 20 62 75 63 6b 65 74 | 73 2c 20 20 73 65 70 61 | bucket|s, sepa|
|000047e0| 72 61 74 65 64 20 20 62 | 79 20 20 61 0d 20 20 20 |rated b|y a. |
|000047f0| 20 20 73 6c 61 73 68 2e | 29 0d 0d 20 20 20 20 20 | slash.|).. |
|00004800| 4d 75 6c 74 69 2d 64 69 | 6d 65 6e 73 69 6f 6e 61 |Multi-di|mensiona|
|00004810| 6c 20 61 72 72 61 79 73 | 20 61 72 65 20 6e 6f 74 |l arrays| are not|
|00004820| 20 64 69 72 65 63 74 6c | 79 20 73 75 70 70 6f 72 | directl|y suppor|
|00004830| 74 65 64 2c 20 62 75 74 | 20 73 65 65 0d 20 20 20 |ted, but| see. |
|00004840| 20 20 74 68 65 20 20 64 | 69 73 63 75 73 73 69 6f | the d|iscussio|
|00004850| 6e 20 6f 66 20 74 68 65 | 20 24 3b 20 76 61 72 69 |n of the| $; vari|
|00004860| 61 62 6c 65 20 6c 61 74 | 65 72 20 66 6f 72 20 61 |able lat|er for a|
|00004870| 20 6d 65 61 6e 73 20 6f | 66 20 65 6d 75 2d 0d 20 | means o|f emu-. |
|00004880| 20 20 20 20 6c 61 74 69 | 6e 67 20 6d 75 6c 74 69 | lati|ng multi|
|00004890| 70 6c 65 20 73 75 62 73 | 63 72 69 70 74 73 20 77 |ple subs|cripts w|
|000048a0| 69 74 68 20 61 6e 20 61 | 73 73 6f 63 69 61 74 69 |ith an a|ssociati|
|000048b0| 76 65 20 20 61 72 72 61 | 79 2e 20 20 20 59 6f 75 |ve arra|y. You|
|000048c0| 0d 20 20 20 20 20 63 6f | 75 6c 64 20 20 61 6c 73 |. co|uld als|
|000048d0| 6f 20 20 77 72 69 74 65 | 20 20 61 20 73 75 62 72 |o write| a subr|
|000048e0| 6f 75 74 69 6e 65 20 74 | 6f 20 74 75 72 6e 20 6d |outine t|o turn m|
|000048f0| 75 6c 74 69 70 6c 65 20 | 73 75 62 73 63 72 69 70 |ultiple |subscrip|
|00004900| 74 73 0d 20 20 20 20 20 | 69 6e 74 6f 20 61 20 73 |ts. |into a s|
|00004910| 69 6e 67 6c 65 20 73 75 | 62 73 63 72 69 70 74 2e |ingle su|bscript.|
|00004920| 0d 0d 20 20 20 20 20 45 | 76 65 72 79 20 64 61 74 |.. E|very dat|
|00004930| 61 20 74 79 70 65 20 68 | 61 73 20 69 74 73 20 6f |a type h|as its o|
|00004940| 77 6e 20 20 6e 61 6d 65 | 73 70 61 63 65 2e 20 20 |wn name|space. |
|00004950| 20 59 6f 75 20 20 63 61 | 6e 2c 20 20 77 69 74 68 | You ca|n, with|
|00004960| 6f 75 74 0d 20 20 20 20 | 20 66 65 61 72 20 20 6f |out. | fear o|
|00004970| 66 20 20 63 6f 6e 66 6c | 69 63 74 2c 20 75 73 65 |f confl|ict, use|
|00004980| 20 74 68 65 20 73 61 6d | 65 20 6e 61 6d 65 20 66 | the sam|e name f|
|00004990| 6f 72 20 61 20 73 63 61 | 6c 61 72 20 76 61 72 69 |or a sca|lar vari|
|000049a0| 61 62 6c 65 2c 0d 20 20 | 20 20 20 61 6e 20 61 72 |able,. | an ar|
|000049b0| 72 61 79 2c 20 61 6e 20 | 61 73 73 6f 63 69 61 74 |ray, an |associat|
|000049c0| 69 76 65 20 61 72 72 61 | 79 2c 20 61 20 66 69 6c |ive arra|y, a fil|
|000049d0| 65 68 61 6e 64 6c 65 2c | 20 20 61 20 20 73 75 62 |ehandle,| a sub|
|000049e0| 72 6f 75 74 69 6e 65 0d | 20 20 20 20 20 6e 61 6d |routine.| nam|
|000049f0| 65 2c 20 20 61 6e 64 2f | 6f 72 20 20 61 20 6c 61 |e, and/|or a la|
|00004a00| 62 65 6c 2e 20 20 53 69 | 6e 63 65 20 76 61 72 69 |bel. Si|nce vari|
|00004a10| 61 62 6c 65 20 61 6e 64 | 20 61 72 72 61 79 20 72 |able and| array r|
|00004a20| 65 66 65 72 65 6e 63 65 | 73 0d 20 20 20 20 20 61 |eference|s. a|
|00004a30| 6c 77 61 79 73 20 73 74 | 61 72 74 20 77 69 74 68 |lways st|art with|
|00004a40| 20 27 24 27 2c 20 27 40 | 27 2c 20 6f 72 20 20 27 | '$', '@|', or '|
|00004a50| 25 27 2c 20 20 74 68 65 | 20 20 22 72 65 73 65 72 |%', the| "reser|
|00004a60| 76 65 64 22 20 20 77 6f | 72 64 73 0d 20 20 20 20 |ved" wo|rds. |
|00004a70| 20 61 72 65 6e 27 74 20 | 20 69 6e 20 20 66 61 63 | aren't | in fac|
|00004a80| 74 20 20 72 65 73 65 72 | 76 65 64 20 20 77 69 74 |t reser|ved wit|
|00004a90| 68 20 20 72 65 73 70 65 | 63 74 20 74 6f 20 76 61 |h respe|ct to va|
|00004aa0| 72 69 61 62 6c 65 20 6e | 61 6d 65 73 2e 0d 0d 20 |riable n|ames... |
|00004ab0| 20 20 20 20 28 54 68 65 | 79 20 41 52 45 20 72 65 | (The|y ARE re|
|00004ac0| 73 65 72 76 65 64 20 77 | 69 74 68 20 72 65 73 70 |served w|ith resp|
|00004ad0| 65 63 74 20 74 6f 20 6c | 61 62 65 6c 73 20 20 61 |ect to l|abels a|
|00004ae0| 6e 64 20 20 66 69 6c 65 | 68 61 6e 64 6c 65 73 2c |nd file|handles,|
|00004af0| 0d 20 20 20 20 20 68 6f | 77 65 76 65 72 2c 20 20 |. ho|wever, |
|00004b00| 77 68 69 63 68 20 20 64 | 6f 6e 27 74 20 20 68 61 |which d|on't ha|
|00004b10| 76 65 20 20 61 6e 20 20 | 69 6e 69 74 69 61 6c 20 |ve an |initial |
|00004b20| 73 70 65 63 69 61 6c 20 | 63 68 61 72 61 63 74 65 |special |characte|
|00004b30| 72 2e 0d 20 20 20 20 20 | 48 69 6e 74 3a 20 20 79 |r.. |Hint: y|
|00004b40| 6f 75 20 20 63 6f 75 6c | 64 20 20 73 61 79 20 20 |ou coul|d say |
|00004b50| 20 6f 70 65 6e 28 4c 4f | 47 2c 27 6c 6f 67 66 69 | open(LO|G,'logfi|
|00004b60| 6c 65 27 29 20 20 20 72 | 61 74 68 65 72 20 20 20 |le') r|ather |
|00004b70| 74 68 61 6e 0d 20 20 20 | 20 20 6f 70 65 6e 28 6c |than. | open(l|
|00004b80| 6f 67 2c 27 6c 6f 67 66 | 69 6c 65 27 29 2e 20 20 |og,'logf|ile'). |
|00004b90| 20 20 55 73 69 6e 67 20 | 20 20 75 70 70 65 72 63 | Using | upperc|
|00004ba0| 61 73 65 20 20 66 69 6c | 65 68 61 6e 64 6c 65 73 |ase fil|ehandles|
|00004bb0| 20 20 61 6c 73 6f 0d 20 | 20 20 20 20 69 6d 70 72 | also. | impr|
|00004bc0| 6f 76 65 73 20 72 65 61 | 64 61 62 69 6c 69 74 79 |oves rea|dability|
|00004bd0| 20 61 6e 64 20 70 72 6f | 74 65 63 74 73 20 20 79 | and pro|tects y|
|00004be0| 6f 75 20 20 66 72 6f 6d | 20 20 63 6f 6e 66 6c 69 |ou from| confli|
|00004bf0| 63 74 20 20 77 69 74 68 | 0d 20 20 20 20 20 66 75 |ct with|. fu|
|00004c00| 74 75 72 65 20 20 72 65 | 73 65 72 76 65 64 20 20 |ture re|served |
|00004c10| 77 6f 72 64 73 2e 29 20 | 20 43 61 73 65 20 49 53 |words.) | Case IS|
|00004c20| 20 73 69 67 6e 69 66 69 | 63 61 6e 74 2d 2d 22 46 | signifi|cant--"F|
|00004c30| 4f 4f 22 2c 20 22 46 6f | 6f 22 0d 20 20 20 20 20 |OO", "Fo|o". |
|00004c40| 61 6e 64 20 22 66 6f 6f | 22 20 61 72 65 20 61 6c |and "foo|" are al|
|00004c50| 6c 20 64 69 66 66 65 72 | 65 6e 74 20 6e 61 6d 65 |l differ|ent name|
|00004c60| 73 2e 20 20 4e 61 6d 65 | 73 20 77 68 69 63 68 20 |s. Name|s which |
|00004c70| 73 74 61 72 74 20 77 69 | 74 68 20 61 0d 20 20 20 |start wi|th a. |
|00004c80| 20 20 6c 65 74 74 65 72 | 20 6d 61 79 20 61 6c 73 | letter| may als|
|00004c90| 6f 20 63 6f 6e 74 61 69 | 6e 20 64 69 67 69 74 73 |o contai|n digits|
|00004ca0| 20 61 6e 64 20 75 6e 64 | 65 72 73 63 6f 72 65 73 | and und|erscores|
|00004cb0| 2e 20 20 4e 61 6d 65 73 | 20 77 68 69 63 68 0d 20 |. Names| which. |
|00004cc0| 20 20 20 20 64 6f 20 6e | 6f 74 20 73 74 61 72 74 | do n|ot start|
|00004cd0| 20 77 69 74 68 20 61 20 | 6c 65 74 74 65 72 20 61 | with a |letter a|
|00004ce0| 72 65 20 20 6c 69 6d 69 | 74 65 64 20 20 74 6f 20 |re limi|ted to |
|00004cf0| 20 6f 6e 65 20 20 63 68 | 61 72 61 63 74 65 72 2c | one ch|aracter,|
|00004d00| 0d 20 20 20 20 20 65 2e | 67 2e 20 20 22 24 25 22 |. e.|g. "$%"|
|00004d10| 20 6f 72 20 22 24 24 22 | 2e 20 20 28 4d 6f 73 74 | or "$$"|. (Most|
|00004d20| 20 6f 66 20 74 68 65 20 | 6f 6e 65 20 63 68 61 72 | of the |one char|
|00004d30| 61 63 74 65 72 20 6e 61 | 6d 65 73 20 68 61 76 65 |acter na|mes have|
|00004d40| 20 61 0d 20 20 20 20 20 | 70 72 65 64 65 66 69 6e | a. |predefin|
|00004d50| 65 64 20 73 69 67 6e 69 | 66 69 63 61 6e 63 65 20 |ed signi|ficance |
|00004d60| 74 6f 20 70 65 72 6c 2e | 20 20 4d 6f 72 65 20 6c |to perl.| More l|
|00004d70| 61 74 65 72 2e 29 0d 0d | 20 20 20 20 20 4e 75 6d |ater.)..| Num|
|00004d80| 65 72 69 63 20 6c 69 74 | 65 72 61 6c 73 20 61 72 |eric lit|erals ar|
|00004d90| 65 20 73 70 65 63 69 66 | 69 65 64 20 69 6e 20 61 |e specif|ied in a|
|00004da0| 6e 79 20 6f 66 20 74 68 | 65 20 75 73 75 61 6c 20 |ny of th|e usual |
|00004db0| 20 66 6c 6f 61 74 69 6e | 67 0d 20 20 20 20 20 70 | floatin|g. p|
|00004dc0| 6f 69 6e 74 20 6f 72 20 | 69 6e 74 65 67 65 72 20 |oint or |integer |
|00004dd0| 66 6f 72 6d 61 74 73 3a | 0d 0d 20 20 20 20 20 20 |formats:|.. |
|00004de0| 20 20 20 31 32 33 34 35 | 0d 20 20 20 20 20 20 20 | 12345|. |
|00004df0| 20 20 31 32 33 34 35 2e | 36 37 0d 20 20 20 20 20 | 12345.|67. |
|00004e00| 20 20 20 20 2e 32 33 45 | 2d 31 30 0d 20 20 20 20 | .23E|-10. |
|00004e10| 20 20 20 20 20 30 78 66 | 66 66 66 20 20 20 20 20 | 0xf|fff |
|00004e20| 23 20 68 65 78 0d 20 20 | 20 20 20 20 20 20 20 30 |# hex. | 0|
|00004e30| 33 37 37 20 20 23 20 6f | 63 74 61 6c 0d 0d 20 20 |377 # o|ctal.. |
|00004e40| 20 20 20 53 74 72 69 6e | 67 20 6c 69 74 65 72 61 | Strin|g litera|
|00004e50| 6c 73 20 61 72 65 20 64 | 65 6c 69 6d 69 74 65 64 |ls are d|elimited|
|00004e60| 20 62 79 20 20 65 69 74 | 68 65 72 20 20 73 69 6e | by eit|her sin|
|00004e70| 67 6c 65 20 20 6f 72 20 | 20 64 6f 75 62 6c 65 0d |gle or | double.|
|00004e80| 20 20 20 20 20 71 75 6f | 74 65 73 2e 20 20 20 54 | quo|tes. T|
|00004e90| 68 65 79 20 20 77 6f 72 | 6b 20 20 6d 75 63 68 20 |hey wor|k much |
|00004ea0| 20 6c 69 6b 65 20 73 68 | 65 6c 6c 20 71 75 6f 74 | like sh|ell quot|
|00004eb0| 65 73 3a 20 64 6f 75 62 | 6c 65 2d 71 75 6f 74 65 |es: doub|le-quote|
|00004ec0| 64 0d 20 20 20 20 20 73 | 74 72 69 6e 67 20 6c 69 |d. s|tring li|
|00004ed0| 74 65 72 61 6c 73 20 61 | 72 65 20 73 75 62 6a 65 |terals a|re subje|
|00004ee0| 63 74 20 74 6f 20 62 61 | 63 6b 73 6c 61 73 68 20 |ct to ba|ckslash |
|00004ef0| 61 6e 64 20 20 76 61 72 | 69 61 62 6c 65 20 20 73 |and var|iable s|
|00004f00| 75 62 2d 0d 20 20 20 20 | 20 73 74 69 74 75 74 69 |ub-. | stituti|
|00004f10| 6f 6e 3b 20 20 73 69 6e | 67 6c 65 2d 71 75 6f 74 |on; sin|gle-quot|
|00004f20| 65 64 20 73 74 72 69 6e | 67 73 20 61 72 65 20 6e |ed strin|gs are n|
|00004f30| 6f 74 20 28 65 78 63 65 | 70 74 20 66 6f 72 20 5c |ot (exce|pt for \|
|00004f40| 27 20 61 6e 64 0d 20 20 | 20 20 20 5c 5c 29 2e 20 |' and. | \\). |
|00004f50| 20 54 68 65 20 75 73 75 | 61 6c 20 62 61 63 6b 73 | The usu|al backs|
|00004f60| 6c 61 73 68 20 72 75 6c | 65 73 20 61 70 70 6c 79 |lash rul|es apply|
|00004f70| 20 66 6f 72 20 6d 61 6b | 69 6e 67 20 20 63 68 61 | for mak|ing cha|
|00004f80| 72 61 63 74 65 72 73 0d | 20 20 20 20 20 73 75 63 |racters.| suc|
|00004f90| 68 20 20 61 73 20 20 6e | 65 77 6c 69 6e 65 2c 20 |h as n|ewline, |
|00004fa0| 20 74 61 62 2c 20 20 65 | 74 63 2e 2c 20 20 61 73 | tab, e|tc., as|
|00004fb0| 20 77 65 6c 6c 20 61 73 | 20 73 6f 6d 65 20 6d 6f | well as| some mo|
|00004fc0| 72 65 20 65 78 6f 74 69 | 63 0d 20 20 20 20 20 66 |re exoti|c. f|
|00004fd0| 6f 72 6d 73 3a 0d 0d 20 | 20 20 20 20 20 20 20 20 |orms:.. | |
|00004fe0| 20 5c 74 20 20 20 20 20 | 20 20 20 74 61 62 0d 20 | \t | tab. |
|00004ff0| 20 20 20 20 20 20 20 20 | 20 5c 6e 20 20 20 20 20 | | \n |
|00005000| 20 20 20 6e 65 77 6c 69 | 6e 65 0d 20 20 20 20 20 | newli|ne. |
|00005010| 20 20 20 20 20 5c 72 20 | 20 20 20 20 20 20 20 72 | \r | r|
|00005020| 65 74 75 72 6e 0d 20 20 | 20 20 20 20 20 20 20 20 |eturn. | |
|00005030| 5c 66 20 20 20 20 20 20 | 20 20 66 6f 72 6d 20 66 |\f | form f|
|00005040| 65 65 64 0d 20 20 20 20 | 20 20 20 20 20 20 5c 62 |eed. | \b|
|00005050| 20 20 20 20 20 20 20 20 | 62 61 63 6b 73 70 61 63 | |backspac|
|00005060| 65 0d 20 20 20 20 20 20 | 20 20 20 20 5c 61 20 20 |e. | \a |
|00005070| 20 20 20 20 20 20 61 6c | 61 72 6d 20 28 62 65 6c | al|arm (bel|
|00005080| 6c 29 0d 20 20 20 20 20 | 20 20 20 20 20 5c 65 20 |l). | \e |
|00005090| 20 20 20 20 20 20 20 65 | 73 63 61 70 65 0d 20 20 | e|scape. |
|000050a0| 20 20 20 20 20 20 20 20 | 5c 30 33 33 20 20 20 20 | |\033 |
|000050b0| 20 20 6f 63 74 61 6c 20 | 63 68 61 72 0d 20 20 20 | octal |char. |
|000050c0| 20 20 20 20 20 20 20 5c | 78 31 62 20 20 20 20 20 | \|x1b |
|000050d0| 20 68 65 78 20 63 68 61 | 72 0d 20 20 20 20 20 20 | hex cha|r. |
|000050e0| 20 20 20 20 5c 63 5b 20 | 20 20 20 20 20 20 63 6f | \c[ | co|
|000050f0| 6e 74 72 6f 6c 20 63 68 | 61 72 0d 20 20 20 20 20 |ntrol ch|ar. |
|00005100| 20 20 20 20 20 5c 6c 20 | 20 20 20 20 20 20 20 6c | \l | l|
|00005110| 6f 77 65 72 63 61 73 65 | 20 6e 65 78 74 20 63 68 |owercase| next ch|
|00005120| 61 72 0d 20 20 20 20 20 | 20 20 20 20 20 5c 75 20 |ar. | \u |
|00005130| 20 20 20 20 20 20 20 75 | 70 70 65 72 63 61 73 65 | u|ppercase|
|00005140| 20 6e 65 78 74 20 63 68 | 61 72 0d 20 20 20 20 20 | next ch|ar. |
|00005150| 20 20 20 20 20 5c 4c 20 | 20 20 20 20 20 20 20 6c | \L | l|
|00005160| 6f 77 65 72 63 61 73 65 | 20 74 69 6c 6c 20 5c 45 |owercase| till \E|
|00005170| 0d 20 20 20 20 20 20 20 | 20 20 20 5c 55 20 20 20 |. | \U |
|00005180| 20 20 20 20 20 75 70 70 | 65 72 63 61 73 65 20 74 | upp|ercase t|
|00005190| 69 6c 6c 20 5c 45 0d 20 | 20 20 20 20 20 20 20 20 |ill \E. | |
|000051a0| 20 5c 45 20 20 20 20 20 | 20 20 20 65 6e 64 20 63 | \E | end c|
|000051b0| 61 73 65 20 6d 6f 64 69 | 66 69 63 61 74 69 6f 6e |ase modi|fication|
|000051c0| 0d 0d 20 20 20 20 20 59 | 6f 75 20 63 61 6e 20 61 |.. Y|ou can a|
|000051d0| 6c 73 6f 20 65 6d 62 65 | 64 20 6e 65 77 6c 69 6e |lso embe|d newlin|
|000051e0| 65 73 20 64 69 72 65 63 | 74 6c 79 20 69 6e 20 79 |es direc|tly in y|
|000051f0| 6f 75 72 20 20 73 74 72 | 69 6e 67 73 2c 20 20 69 |our str|ings, i|
|00005200| 2e 65 2e 0d 20 20 20 20 | 20 74 68 65 79 20 20 63 |.e.. | they c|
|00005210| 61 6e 20 20 65 6e 64 20 | 6f 6e 20 61 20 64 69 66 |an end |on a dif|
|00005220| 66 65 72 65 6e 74 20 6c | 69 6e 65 20 74 68 61 6e |ferent l|ine than|
|00005230| 20 74 68 65 79 20 62 65 | 67 69 6e 2e 20 20 54 68 | they be|gin. Th|
|00005240| 69 73 20 69 73 0d 20 20 | 20 20 20 6e 69 63 65 2c |is is. | nice,|
|00005250| 20 62 75 74 20 69 66 20 | 79 6f 75 20 66 6f 72 67 | but if |you forg|
|00005260| 65 74 20 79 6f 75 72 20 | 74 72 61 69 6c 69 6e 67 |et your |trailing|
|00005270| 20 71 75 6f 74 65 2c 20 | 74 68 65 20 65 72 72 6f | quote, |the erro|
|00005280| 72 20 20 77 69 6c 6c 0d | 20 20 20 20 20 6e 6f 74 |r will.| not|
|00005290| 20 62 65 20 72 65 70 6f | 72 74 65 64 20 75 6e 74 | be repo|rted unt|
|000052a0| 69 6c 20 70 65 72 6c 20 | 66 69 6e 64 73 20 61 6e |il perl |finds an|
|000052b0| 6f 74 68 65 72 20 6c 69 | 6e 65 20 63 6f 6e 74 61 |other li|ne conta|
|000052c0| 69 6e 69 6e 67 20 74 68 | 65 0d 20 20 20 20 20 71 |ining th|e. q|
|000052d0| 75 6f 74 65 20 63 68 61 | 72 61 63 74 65 72 2c 20 |uote cha|racter, |
|000052e0| 77 68 69 63 68 20 6d 61 | 79 20 62 65 20 6d 75 63 |which ma|y be muc|
|000052f0| 68 20 66 75 72 74 68 65 | 72 20 6f 6e 20 69 6e 20 |h furthe|r on in |
|00005300| 74 68 65 20 73 63 72 69 | 70 74 2e 0d 20 20 20 20 |the scri|pt.. |
|00005310| 20 56 61 72 69 61 62 6c | 65 20 20 73 75 62 73 74 | Variabl|e subst|
|00005320| 69 74 75 74 69 6f 6e 20 | 20 69 6e 73 69 64 65 20 |itution | inside |
|00005330| 20 73 74 72 69 6e 67 73 | 20 69 73 20 6c 69 6d 69 | strings| is limi|
|00005340| 74 65 64 20 74 6f 20 73 | 63 61 6c 61 72 0d 20 20 |ted to s|calar. |
|00005350| 20 20 20 76 61 72 69 61 | 62 6c 65 73 2c 20 6e 6f | varia|bles, no|
|00005360| 72 6d 61 6c 20 61 72 72 | 61 79 20 76 61 6c 75 65 |rmal arr|ay value|
|00005370| 73 2c 20 61 6e 64 20 61 | 72 72 61 79 20 73 6c 69 |s, and a|rray sli|
|00005380| 63 65 73 2e 20 20 28 49 | 6e 20 6f 74 68 65 72 0d |ces. (I|n other.|
|00005390| 20 20 20 20 20 77 6f 72 | 64 73 2c 20 20 69 64 65 | wor|ds, ide|
|000053a0| 6e 74 69 66 69 65 72 73 | 20 20 62 65 67 69 6e 6e |ntifiers| beginn|
|000053b0| 69 6e 67 20 20 77 69 74 | 68 20 20 24 20 6f 72 20 |ing wit|h $ or |
|000053c0| 40 2c 20 66 6f 6c 6c 6f | 77 65 64 20 62 79 20 61 |@, follo|wed by a|
|000053d0| 6e 0d 20 20 20 20 20 6f | 70 74 69 6f 6e 61 6c 20 |n. o|ptional |
|000053e0| 62 72 61 63 6b 65 74 65 | 64 20 65 78 70 72 65 73 |brackete|d expres|
|000053f0| 73 69 6f 6e 20 61 73 20 | 61 20 73 75 62 73 63 72 |sion as |a subscr|
|00005400| 69 70 74 2e 29 20 54 68 | 65 20 66 6f 6c 6c 6f 77 |ipt.) Th|e follow|
|00005410| 69 6e 67 0d 20 20 20 20 | 20 63 6f 64 65 20 73 65 |ing. | code se|
|00005420| 67 6d 65 6e 74 20 70 72 | 69 6e 74 73 20 6f 75 74 |gment pr|ints out|
|00005430| 20 22 54 68 65 20 70 72 | 69 63 65 20 69 73 20 24 | "The pr|ice is $|
|00005440| 31 30 30 2e 22 0d 0d 20 | 20 20 20 20 20 20 20 20 |100.".. | |
|00005450| 24 50 72 69 63 65 20 3d | 20 27 24 31 30 30 27 3b |$Price =| '$100';|
|00005460| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 23 | | #|
|00005470| 20 6e 6f 74 20 69 6e 74 | 65 72 70 72 65 74 65 64 | not int|erpreted|
|00005480| 0d 20 20 20 20 20 20 20 | 20 20 70 72 69 6e 74 20 |. | print |
|00005490| 22 54 68 65 20 70 72 69 | 63 65 20 69 73 20 24 50 |"The pri|ce is $P|
|000054a0| 72 69 63 65 2e 5c 6e 22 | 3b 23 20 69 6e 74 65 72 |rice.\n"|;# inter|
|000054b0| 70 72 65 74 65 64 0d 0d | 20 20 20 20 20 4e 6f 74 |preted..| Not|
|000054c0| 65 20 74 68 61 74 20 79 | 6f 75 20 63 61 6e 20 70 |e that y|ou can p|
|000054d0| 75 74 20 63 75 72 6c 79 | 20 62 72 61 63 6b 65 74 |ut curly| bracket|
|000054e0| 73 20 61 72 6f 75 6e 64 | 20 20 74 68 65 20 20 69 |s around| the i|
|000054f0| 64 65 6e 74 69 66 69 65 | 72 0d 20 20 20 20 20 74 |dentifie|r. t|
|00005500| 6f 20 20 64 65 6c 69 6d | 69 74 20 69 74 20 66 72 |o delim|it it fr|
|00005510| 6f 6d 20 66 6f 6c 6c 6f | 77 69 6e 67 20 61 6c 70 |om follo|wing alp|
|00005520| 68 61 6e 75 6d 65 72 69 | 63 73 2e 20 20 41 6c 73 |hanumeri|cs. Als|
|00005530| 6f 20 6e 6f 74 65 20 74 | 68 61 74 0d 20 20 20 20 |o note t|hat. |
|00005540| 20 61 20 73 69 6e 67 6c | 65 20 71 75 6f 74 65 64 | a singl|e quoted|
|00005550| 20 73 74 72 69 6e 67 20 | 6d 75 73 74 20 62 65 20 | string |must be |
|00005560| 73 65 70 61 72 61 74 65 | 64 20 20 66 72 6f 6d 20 |separate|d from |
|00005570| 20 61 20 20 70 72 65 63 | 65 64 69 6e 67 0d 20 20 | a prec|eding. |
|00005580| 20 20 20 77 6f 72 64 20 | 20 62 79 20 61 20 73 70 | word | by a sp|
|00005590| 61 63 65 2c 20 73 69 6e | 63 65 20 73 69 6e 67 6c |ace, sin|ce singl|
|000055a0| 65 20 71 75 6f 74 65 20 | 69 73 20 61 20 76 61 6c |e quote |is a val|
|000055b0| 69 64 20 63 68 61 72 61 | 63 74 65 72 20 69 6e 0d |id chara|cter in.|
|000055c0| 20 20 20 20 20 61 6e 20 | 69 64 65 6e 74 69 66 69 | an |identifi|
|000055d0| 65 72 20 28 73 65 65 20 | 50 61 63 6b 61 67 65 73 |er (see |Packages|
|000055e0| 29 2e 0d 0d 20 20 20 20 | 20 54 77 6f 20 20 73 70 |)... | Two sp|
|000055f0| 65 63 69 61 6c 20 20 6c | 69 74 65 72 61 6c 73 20 |ecial l|iterals |
|00005600| 20 61 72 65 20 20 5f 5f | 4c 49 4e 45 5f 5f 20 20 | are __|LINE__ |
|00005610| 61 6e 64 20 20 5f 5f 46 | 49 4c 45 5f 5f 2c 20 20 |and __F|ILE__, |
|00005620| 77 68 69 63 68 0d 20 20 | 20 20 20 72 65 70 72 65 |which. | repre|
|00005630| 73 65 6e 74 20 74 68 65 | 20 63 75 72 72 65 6e 74 |sent the| current|
|00005640| 20 6c 69 6e 65 20 6e 75 | 6d 62 65 72 20 61 6e 64 | line nu|mber and|
|00005650| 20 66 69 6c 65 6e 61 6d | 65 20 61 74 20 74 68 61 | filenam|e at tha|
|00005660| 74 20 70 6f 69 6e 74 0d | 20 20 20 20 20 69 6e 20 |t point.| in |
|00005670| 79 6f 75 72 20 70 72 6f | 67 72 61 6d 2e 20 20 54 |your pro|gram. T|
|00005680| 68 65 79 20 6d 61 79 20 | 6f 6e 6c 79 20 62 65 20 |hey may |only be |
|00005690| 75 73 65 64 20 61 73 20 | 73 65 70 61 72 61 74 65 |used as |separate|
|000056a0| 20 20 74 6f 6b 65 6e 73 | 3b 0d 20 20 20 20 20 74 | tokens|;. t|
|000056b0| 68 65 79 20 20 77 69 6c | 6c 20 20 6e 6f 74 20 20 |hey wil|l not |
|000056c0| 62 65 20 69 6e 74 65 72 | 70 6f 6c 61 74 65 64 20 |be inter|polated |
|000056d0| 69 6e 74 6f 20 73 74 72 | 69 6e 67 73 2e 20 20 49 |into str|ings. I|
|000056e0| 6e 20 61 64 64 69 74 69 | 6f 6e 2c 0d 20 20 20 20 |n additi|on,. |
|000056f0| 20 74 68 65 20 74 6f 6b | 65 6e 20 5f 5f 45 4e 44 | the tok|en __END|
|00005700| 5f 5f 20 6d 61 79 20 62 | 65 20 75 73 65 64 20 74 |__ may b|e used t|
|00005710| 6f 20 69 6e 64 69 63 61 | 74 65 20 74 68 65 20 6c |o indica|te the l|
|00005720| 6f 67 69 63 61 6c 20 65 | 6e 64 20 6f 66 0d 20 20 |ogical e|nd of. |
|00005730| 20 20 20 74 68 65 20 20 | 73 63 72 69 70 74 20 20 | the |script |
|00005740| 62 65 66 6f 72 65 20 20 | 74 68 65 20 20 61 63 74 |before |the act|
|00005750| 75 61 6c 20 65 6e 64 20 | 6f 66 20 66 69 6c 65 2e |ual end |of file.|
|00005760| 20 20 41 6e 79 20 66 6f | 6c 6c 6f 77 69 6e 67 0d | Any fo|llowing.|
|00005770| 20 20 20 20 20 74 65 78 | 74 20 69 73 20 69 67 6e | tex|t is ign|
|00005780| 6f 72 65 64 20 28 62 75 | 74 20 6d 61 79 20 62 65 |ored (bu|t may be|
|00005790| 20 72 65 61 64 20 76 69 | 61 20 74 68 65 20 20 44 | read vi|a the D|
|000057a0| 41 54 41 20 20 66 69 6c | 65 68 61 6e 64 6c 65 29 |ATA fil|ehandle)|
|000057b0| 2e 0d 20 20 20 20 20 54 | 68 65 20 20 74 77 6f 20 |.. T|he two |
|000057c0| 20 63 6f 6e 74 72 6f 6c | 20 20 63 68 61 72 61 63 | control| charac|
|000057d0| 74 65 72 73 20 20 5e 44 | 20 20 61 6e 64 20 20 5e |ters ^D| and ^|
|000057e0| 5a 20 20 61 72 65 20 73 | 79 6e 6f 6e 79 6d 73 20 |Z are s|ynonyms |
|000057f0| 66 6f 72 0d 20 20 20 20 | 20 5f 5f 45 4e 44 5f 5f |for. | __END__|
|00005800| 2e 0d 0d 20 20 20 20 20 | 41 20 77 6f 72 64 20 74 |... |A word t|
|00005810| 68 61 74 20 64 6f 65 73 | 6e 27 74 20 68 61 76 65 |hat does|n't have|
|00005820| 20 61 6e 79 20 20 6f 74 | 68 65 72 20 20 69 6e 74 | any ot|her int|
|00005830| 65 72 70 72 65 74 61 74 | 69 6f 6e 20 20 69 6e 20 |erpretat|ion in |
|00005840| 20 74 68 65 0d 20 20 20 | 20 20 67 72 61 6d 6d 61 | the. | gramma|
|00005850| 72 20 20 77 69 6c 6c 20 | 20 62 65 20 20 74 72 65 |r will | be tre|
|00005860| 61 74 65 64 20 61 73 20 | 69 66 20 69 74 20 68 61 |ated as |if it ha|
|00005870| 64 20 73 69 6e 67 6c 65 | 20 71 75 6f 74 65 73 20 |d single| quotes |
|00005880| 61 72 6f 75 6e 64 0d 20 | 20 20 20 20 69 74 2e 20 |around. | it. |
|00005890| 20 46 6f 72 20 74 68 69 | 73 20 70 75 72 70 6f 73 | For thi|s purpos|
|000058a0| 65 2c 20 61 20 77 6f 72 | 64 20 63 6f 6e 73 69 73 |e, a wor|d consis|
|000058b0| 74 73 20 6f 6e 6c 79 20 | 6f 66 20 20 61 6c 70 68 |ts only |of alph|
|000058c0| 61 6e 75 6d 65 72 69 63 | 0d 20 20 20 20 20 63 68 |anumeric|. ch|
|000058d0| 61 72 61 63 74 65 72 73 | 20 20 61 6e 64 20 75 6e |aracters| and un|
|000058e0| 64 65 72 6c 69 6e 65 2c | 20 61 6e 64 20 6d 75 73 |derline,| and mus|
|000058f0| 74 20 73 74 61 72 74 20 | 77 69 74 68 20 61 6e 20 |t start |with an |
|00005900| 61 6c 70 68 61 62 65 74 | 69 63 0d 20 20 20 20 20 |alphabet|ic. |
|00005910| 63 68 61 72 61 63 74 65 | 72 2e 20 20 41 73 20 77 |characte|r. As w|
|00005920| 69 74 68 20 66 69 6c 65 | 68 61 6e 64 6c 65 73 20 |ith file|handles |
|00005930| 61 6e 64 20 6c 61 62 65 | 6c 73 2c 20 61 20 62 61 |and labe|ls, a ba|
|00005940| 72 65 20 77 6f 72 64 20 | 74 68 61 74 0d 20 20 20 |re word |that. |
|00005950| 20 20 63 6f 6e 73 69 73 | 74 73 20 20 65 6e 74 69 | consis|ts enti|
|00005960| 72 65 6c 79 20 20 6f 66 | 20 6c 6f 77 65 72 63 61 |rely of| lowerca|
|00005970| 73 65 20 6c 65 74 74 65 | 72 73 20 72 69 73 6b 73 |se lette|rs risks|
|00005980| 20 63 6f 6e 66 6c 69 63 | 74 20 77 69 74 68 0d 20 | conflic|t with. |
|00005990| 20 20 20 20 66 75 74 75 | 72 65 20 72 65 73 65 72 | futu|re reser|
|000059a0| 76 65 64 20 77 6f 72 64 | 73 2c 20 61 6e 64 20 69 |ved word|s, and i|
|000059b0| 66 20 79 6f 75 20 75 73 | 65 20 74 68 65 20 20 2d |f you us|e the -|
|000059c0| 77 20 20 73 77 69 74 63 | 68 2c 20 20 50 65 72 6c |w switc|h, Perl|
|000059d0| 0d 20 20 20 20 20 77 69 | 6c 6c 20 77 61 72 6e 20 |. wi|ll warn |
|000059e0| 79 6f 75 20 61 62 6f 75 | 74 20 61 6e 79 20 73 75 |you abou|t any su|
|000059f0| 63 68 20 77 6f 72 64 73 | 2e 0d 0d 20 20 20 20 20 |ch words|... |
|00005a00| 41 72 72 61 79 20 76 61 | 6c 75 65 73 20 61 72 65 |Array va|lues are|
|00005a10| 20 69 6e 74 65 72 70 6f | 6c 61 74 65 64 20 69 6e | interpo|lated in|
|00005a20| 74 6f 20 64 6f 75 62 6c | 65 2d 71 75 6f 74 65 64 |to doubl|e-quoted|
|00005a30| 20 73 74 72 69 6e 67 73 | 20 20 62 79 0d 20 20 20 | strings| by. |
|00005a40| 20 20 6a 6f 69 6e 69 6e | 67 20 20 61 6c 6c 20 20 | joinin|g all |
|00005a50| 74 68 65 20 20 65 6c 65 | 6d 65 6e 74 73 20 20 6f |the ele|ments o|
|00005a60| 66 20 74 68 65 20 61 72 | 72 61 79 20 77 69 74 68 |f the ar|ray with|
|00005a70| 20 74 68 65 20 64 65 6c | 69 6d 69 74 65 72 0d 20 | the del|imiter. |
|00005a80| 20 20 20 20 73 70 65 63 | 69 66 69 65 64 20 69 6e | spec|ified in|
|00005a90| 20 74 68 65 20 24 22 20 | 76 61 72 69 61 62 6c 65 | the $" |variable|
|00005aa0| 2c 20 73 70 61 63 65 20 | 62 79 20 64 65 66 61 75 |, space |by defau|
|00005ab0| 6c 74 2e 20 20 20 28 53 | 69 6e 63 65 20 20 69 6e |lt. (S|ince in|
|00005ac0| 0d 20 20 20 20 20 76 65 | 72 73 69 6f 6e 73 20 20 |. ve|rsions |
|00005ad0| 6f 66 20 20 70 65 72 6c | 20 20 70 72 69 6f 72 20 |of perl| prior |
|00005ae0| 20 74 6f 20 20 33 2e 30 | 20 74 68 65 20 40 20 63 | to 3.0| the @ c|
|00005af0| 68 61 72 61 63 74 65 72 | 20 77 61 73 20 6e 6f 74 |haracter| was not|
|00005b00| 20 61 0d 20 20 20 20 20 | 6d 65 74 61 63 68 61 72 | a. |metachar|
|00005b10| 61 63 74 65 72 20 69 6e | 20 64 6f 75 62 6c 65 2d |acter in| double-|
|00005b20| 71 75 6f 74 65 64 20 73 | 74 72 69 6e 67 73 2c 20 |quoted s|trings, |
|00005b30| 74 68 65 20 69 6e 74 65 | 72 70 6f 6c 61 74 69 6f |the inte|rpolatio|
|00005b40| 6e 20 6f 66 0d 20 20 20 | 20 20 40 61 72 72 61 79 |n of. | @array|
|00005b50| 2c 20 20 20 24 61 72 72 | 61 79 5b 45 58 50 52 5d |, $arr|ay[EXPR]|
|00005b60| 2c 20 20 20 40 61 72 72 | 61 79 5b 4c 49 53 54 5d |, @arr|ay[LIST]|
|00005b70| 2c 20 20 20 24 61 72 72 | 61 79 7b 45 58 50 52 7d |, $arr|ay{EXPR}|
|00005b80| 2c 20 20 20 6f 72 0d 20 | 20 20 20 20 40 61 72 72 |, or. | @arr|
|00005b90| 61 79 7b 4c 49 53 54 7d | 20 6f 6e 6c 79 20 68 61 |ay{LIST}| only ha|
|00005ba0| 70 70 65 6e 73 20 69 66 | 20 61 72 72 61 79 20 69 |ppens if| array i|
|00005bb0| 73 20 20 72 65 66 65 72 | 65 6e 63 65 64 20 20 65 |s refer|enced e|
|00005bc0| 6c 73 65 77 68 65 72 65 | 0d 20 20 20 20 20 69 6e |lsewhere|. in|
|00005bd0| 20 20 20 74 68 65 20 20 | 70 72 6f 67 72 61 6d 20 | the |program |
|00005be0| 20 6f 72 20 20 69 73 20 | 20 70 72 65 64 65 66 69 | or is | predefi|
|00005bf0| 6e 65 64 2e 29 20 20 54 | 68 65 20 20 66 6f 6c 6c |ned.) T|he foll|
|00005c00| 6f 77 69 6e 67 20 20 61 | 72 65 0d 20 20 20 20 20 |owing a|re. |
|00005c10| 65 71 75 69 76 61 6c 65 | 6e 74 3a 0d 0d 20 20 20 |equivale|nt:.. |
|00005c20| 20 20 20 20 20 20 20 24 | 74 65 6d 70 20 3d 20 6a | $|temp = j|
|00005c30| 6f 69 6e 28 24 22 2c 40 | 41 52 47 56 29 3b 0d 20 |oin($",@|ARGV);. |
|00005c40| 20 20 20 20 20 20 20 20 | 20 73 79 73 74 65 6d 20 | | system |
|00005c50| 22 65 63 68 6f 20 24 74 | 65 6d 70 22 3b 0d 0d 20 |"echo $t|emp";.. |
|00005c60| 20 20 20 20 20 20 20 20 | 20 73 79 73 74 65 6d 20 | | system |
|00005c70| 22 65 63 68 6f 20 40 41 | 52 47 56 22 3b 0d 0d 20 |"echo @A|RGV";.. |
|00005c80| 20 20 20 20 57 69 74 68 | 69 6e 20 73 65 61 72 63 | With|in searc|
|00005c90| 68 20 70 61 74 74 65 72 | 6e 73 20 28 77 68 69 63 |h patter|ns (whic|
|00005ca0| 68 20 20 61 6c 73 6f 20 | 20 75 6e 64 65 72 67 6f |h also | undergo|
|00005cb0| 20 20 64 6f 75 62 6c 65 | 2d 71 75 6f 74 69 73 68 | double|-quotish|
|00005cc0| 0d 20 20 20 20 20 73 75 | 62 73 74 69 74 75 74 69 |. su|bstituti|
|00005cd0| 6f 6e 29 20 20 74 68 65 | 72 65 20 20 69 73 20 61 |on) the|re is a|
|00005ce0| 20 62 61 64 20 61 6d 62 | 69 67 75 69 74 79 3a 20 | bad amb|iguity: |
|00005cf0| 20 49 73 20 2f 24 66 6f | 6f 5b 62 61 72 5d 2f 20 | Is /$fo|o[bar]/ |
|00005d00| 74 6f 0d 20 20 20 20 20 | 62 65 20 69 6e 74 65 72 |to. |be inter|
|00005d10| 70 72 65 74 65 64 20 61 | 73 20 2f 24 7b 66 6f 6f |preted a|s /${foo|
|00005d20| 7d 5b 62 61 72 5d 2f 20 | 28 77 68 65 72 65 20 5b |}[bar]/ |(where [|
|00005d30| 62 61 72 5d 20 69 73 20 | 61 20 20 63 68 61 72 61 |bar] is |a chara|
|00005d40| 63 74 65 72 0d 20 20 20 | 20 20 63 6c 61 73 73 20 |cter. | class |
|00005d50| 66 6f 72 20 74 68 65 20 | 72 65 67 75 6c 61 72 20 |for the |regular |
|00005d60| 65 78 70 72 65 73 73 69 | 6f 6e 29 20 6f 72 20 61 |expressi|on) or a|
|00005d70| 73 20 2f 24 7b 66 6f 6f | 5b 62 61 72 5d 7d 2f 20 |s /${foo|[bar]}/ |
|00005d80| 28 77 68 65 72 65 0d 20 | 20 20 20 20 5b 62 61 72 |(where. | [bar|
|00005d90| 5d 20 69 73 20 74 68 65 | 20 73 75 62 73 63 72 69 |] is the| subscri|
|00005da0| 70 74 20 74 6f 20 20 61 | 72 72 61 79 20 20 40 66 |pt to a|rray @f|
|00005db0| 6f 6f 29 3f 20 20 20 49 | 66 20 20 40 66 6f 6f 20 |oo)? I|f @foo |
|00005dc0| 20 64 6f 65 73 6e 27 74 | 0d 20 20 20 20 20 6f 74 | doesn't|. ot|
|00005dd0| 68 65 72 77 69 73 65 20 | 20 65 78 69 73 74 2c 20 |herwise | exist, |
|00005de0| 74 68 65 6e 20 69 74 27 | 73 20 6f 62 76 69 6f 75 |then it'|s obviou|
|00005df0| 73 6c 79 20 61 20 63 68 | 61 72 61 63 74 65 72 20 |sly a ch|aracter |
|00005e00| 63 6c 61 73 73 2e 20 20 | 49 66 0d 20 20 20 20 20 |class. |If. |
|00005e10| 40 66 6f 6f 20 65 78 69 | 73 74 73 2c 20 70 65 72 |@foo exi|sts, per|
|00005e20| 6c 20 74 61 6b 65 73 20 | 61 20 67 6f 6f 64 20 67 |l takes |a good g|
|00005e30| 75 65 73 73 20 20 61 62 | 6f 75 74 20 20 5b 62 61 |uess ab|out [ba|
|00005e40| 72 5d 2c 20 20 61 6e 64 | 20 20 69 73 0d 20 20 20 |r], and| is. |
|00005e50| 20 20 61 6c 6d 6f 73 74 | 20 20 61 6c 77 61 79 73 | almost| always|
|00005e60| 20 20 72 69 67 68 74 2e | 20 20 49 66 20 69 74 20 | right.| If it |
|00005e70| 64 6f 65 73 20 67 75 65 | 73 73 20 77 72 6f 6e 67 |does gue|ss wrong|
|00005e80| 2c 20 6f 72 20 69 66 20 | 79 6f 75 27 72 65 0d 20 |, or if |you're. |
|00005e90| 20 20 20 20 6a 75 73 74 | 20 70 6c 61 69 6e 20 70 | just| plain p|
|00005ea0| 61 72 61 6e 6f 69 64 2c | 20 79 6f 75 20 63 61 6e |aranoid,| you can|
|00005eb0| 20 66 6f 72 63 65 20 74 | 68 65 20 20 63 6f 72 72 | force t|he corr|
|00005ec0| 65 63 74 20 20 69 6e 74 | 65 72 70 72 65 74 61 2d |ect int|erpreta-|
|00005ed0| 0d 20 20 20 20 20 74 69 | 6f 6e 20 77 69 74 68 20 |. ti|on with |
|00005ee0| 63 75 72 6c 79 20 62 72 | 61 63 6b 65 74 73 20 61 |curly br|ackets a|
|00005ef0| 73 20 61 62 6f 76 65 2e | 0d 0d 20 20 20 20 20 41 |s above.|.. A|
|00005f00| 20 6c 69 6e 65 2d 6f 72 | 69 65 6e 74 65 64 20 66 | line-or|iented f|
|00005f10| 6f 72 6d 20 6f 66 20 71 | 75 6f 74 69 6e 67 20 69 |orm of q|uoting i|
|00005f20| 73 20 62 61 73 65 64 20 | 6f 6e 20 74 68 65 20 73 |s based |on the s|
|00005f30| 68 65 6c 6c 20 20 68 65 | 72 65 2d 0d 20 20 20 20 |hell he|re-. |
|00005f40| 20 69 73 20 73 79 6e 74 | 61 78 2e 20 20 46 6f 6c | is synt|ax. Fol|
|00005f50| 6c 6f 77 69 6e 67 20 61 | 20 3c 3c 20 79 6f 75 20 |lowing a| << you |
|00005f60| 73 70 65 63 69 66 79 20 | 61 20 73 74 72 69 6e 67 |specify |a string|
|00005f70| 20 74 6f 20 74 65 72 6d | 69 6e 61 74 65 0d 20 20 | to term|inate. |
|00005f80| 20 20 20 74 68 65 20 71 | 75 6f 74 65 64 20 6d 61 | the q|uoted ma|
|00005f90| 74 65 72 69 61 6c 2c 20 | 61 6e 64 20 61 6c 6c 20 |terial, |and all |
|00005fa0| 20 6c 69 6e 65 73 20 20 | 66 6f 6c 6c 6f 77 69 6e | lines |followin|
|00005fb0| 67 20 20 74 68 65 20 20 | 63 75 72 72 65 6e 74 0d |g the |current.|
|00005fc0| 20 20 20 20 20 6c 69 6e | 65 20 20 64 6f 77 6e 20 | lin|e down |
|00005fd0| 20 74 6f 20 20 74 68 65 | 20 20 74 65 72 6d 69 6e | to the| termin|
|00005fe0| 61 74 69 6e 67 20 73 74 | 72 69 6e 67 20 61 72 65 |ating st|ring are|
|00005ff0| 20 74 68 65 20 76 61 6c | 75 65 20 6f 66 20 74 68 | the val|ue of th|
|00006000| 65 0d 20 20 20 20 20 69 | 74 65 6d 2e 20 20 54 68 |e. i|tem. Th|
|00006010| 65 20 74 65 72 6d 69 6e | 61 74 69 6e 67 20 73 74 |e termin|ating st|
|00006020| 72 69 6e 67 20 6d 61 79 | 20 62 65 20 65 69 74 68 |ring may| be eith|
|00006030| 65 72 20 61 6e 20 69 64 | 65 6e 74 69 66 69 65 72 |er an id|entifier|
|00006040| 20 28 61 0d 20 20 20 20 | 20 77 6f 72 64 29 2c 20 | (a. | word), |
|00006050| 20 6f 72 20 20 73 6f 6d | 65 20 71 75 6f 74 65 64 | or som|e quoted|
|00006060| 20 74 65 78 74 2e 20 20 | 49 66 20 71 75 6f 74 65 | text. |If quote|
|00006070| 64 2c 20 74 68 65 20 74 | 79 70 65 20 6f 66 20 71 |d, the t|ype of q|
|00006080| 75 6f 74 65 73 0d 20 20 | 20 20 20 79 6f 75 20 75 |uotes. | you u|
|00006090| 73 65 20 64 65 74 65 72 | 6d 69 6e 65 73 20 74 68 |se deter|mines th|
|000060a0| 65 20 74 72 65 61 74 6d | 65 6e 74 20 6f 66 20 74 |e treatm|ent of t|
|000060b0| 68 65 20 20 74 65 78 74 | 2c 20 20 6a 75 73 74 20 |he text|, just |
|000060c0| 20 61 73 20 20 69 6e 0d | 20 20 20 20 20 72 65 67 | as in.| reg|
|000060d0| 75 6c 61 72 20 20 71 75 | 6f 74 69 6e 67 2e 20 20 |ular qu|oting. |
|000060e0| 20 41 6e 20 75 6e 71 75 | 6f 74 65 64 20 69 64 65 | An unqu|oted ide|
|000060f0| 6e 74 69 66 69 65 72 20 | 77 6f 72 6b 73 20 6c 69 |ntifier |works li|
|00006100| 6b 65 20 64 6f 75 62 6c | 65 0d 20 20 20 20 20 71 |ke doubl|e. q|
|00006110| 75 6f 74 65 73 2e 20 20 | 54 68 65 72 65 20 6d 75 |uotes. |There mu|
|00006120| 73 74 20 62 65 20 6e 6f | 20 73 70 61 63 65 20 62 |st be no| space b|
|00006130| 65 74 77 65 65 6e 20 74 | 68 65 20 3c 3c 20 61 6e |etween t|he << an|
|00006140| 64 20 74 68 65 20 69 64 | 65 6e 2d 0d 20 20 20 20 |d the id|en-. |
|00006150| 20 74 69 66 69 65 72 2e | 20 20 20 28 49 66 20 20 | tifier.| (If |
|00006160| 79 6f 75 20 20 70 75 74 | 20 61 20 73 70 61 63 65 |you put| a space|
|00006170| 20 69 74 20 77 69 6c 6c | 20 62 65 20 74 72 65 61 | it will| be trea|
|00006180| 74 65 64 20 61 73 20 61 | 20 6e 75 6c 6c 0d 20 20 |ted as a| null. |
|00006190| 20 20 20 69 64 65 6e 74 | 69 66 69 65 72 2c 20 77 | ident|ifier, w|
|000061a0| 68 69 63 68 20 69 73 20 | 76 61 6c 69 64 2c 20 20 |hich is |valid, |
|000061b0| 61 6e 64 20 20 6d 61 74 | 63 68 65 73 20 20 74 68 |and mat|ches th|
|000061c0| 65 20 20 66 69 72 73 74 | 20 20 62 6c 61 6e 6b 0d |e first| blank.|
|000061d0| 20 20 20 20 20 6c 69 6e | 65 2d 2d 73 65 65 20 20 | lin|e--see |
|000061e0| 4d 65 72 72 79 20 20 43 | 68 72 69 73 74 6d 61 73 |Merry C|hristmas|
|000061f0| 20 20 65 78 61 6d 70 6c | 65 20 62 65 6c 6f 77 2e | exampl|e below.|
|00006200| 29 20 54 68 65 20 74 65 | 72 6d 69 6e 61 74 69 6e |) The te|rminatin|
|00006210| 67 0d 20 20 20 20 20 73 | 74 72 69 6e 67 20 6d 75 |g. s|tring mu|
|00006220| 73 74 20 61 70 70 65 61 | 72 20 62 79 20 69 74 73 |st appea|r by its|
|00006230| 65 6c 66 20 28 75 6e 71 | 75 6f 74 65 64 20 61 6e |elf (unq|uoted an|
|00006240| 64 20 77 69 74 68 20 6e | 6f 20 73 75 72 72 6f 75 |d with n|o surrou|
|00006250| 6e 64 2d 0d 20 20 20 20 | 20 69 6e 67 20 77 68 69 |nd-. | ing whi|
|00006260| 74 65 73 70 61 63 65 29 | 20 6f 6e 20 74 68 65 20 |tespace)| on the |
|00006270| 74 65 72 6d 69 6e 61 74 | 69 6e 67 20 6c 69 6e 65 |terminat|ing line|
|00006280| 2e 0d 0d 20 20 20 20 20 | 20 20 20 20 20 70 72 69 |... | pri|
|00006290| 6e 74 20 3c 3c 45 4f 46 | 3b 20 20 20 20 20 20 20 |nt <<EOF|; |
|000062a0| 20 23 20 73 61 6d 65 20 | 61 73 20 61 62 6f 76 65 | # same |as above|
|000062b0| 0d 20 20 20 20 20 54 68 | 65 20 70 72 69 63 65 20 |. Th|e price |
|000062c0| 69 73 20 24 50 72 69 63 | 65 2e 0d 20 20 20 20 20 |is $Pric|e.. |
|000062d0| 45 4f 46 0d 0d 20 20 20 | 20 20 20 20 20 20 20 70 |EOF.. | p|
|000062e0| 72 69 6e 74 20 3c 3c 22 | 45 4f 46 22 3b 20 20 20 |rint <<"|EOF"; |
|000062f0| 20 20 20 23 20 73 61 6d | 65 20 61 73 20 61 62 6f | # sam|e as abo|
|00006300| 76 65 0d 20 20 20 20 20 | 54 68 65 20 70 72 69 63 |ve. |The pric|
|00006310| 65 20 69 73 20 24 50 72 | 69 63 65 2e 0d 20 20 20 |e is $Pr|ice.. |
|00006320| 20 20 45 4f 46 0d 0d 20 | 20 20 20 20 20 20 20 20 | EOF.. | |
|00006330| 20 70 72 69 6e 74 20 3c | 3c 20 78 20 31 30 3b 20 | print <|< x 10; |
|00006340| 20 20 20 20 20 23 20 6e | 75 6c 6c 20 69 64 65 6e | # n|ull iden|
|00006350| 74 69 66 69 65 72 20 69 | 73 20 64 65 6c 69 6d 69 |tifier i|s delimi|
|00006360| 74 65 72 0d 20 20 20 20 | 20 4d 65 72 72 79 20 43 |ter. | Merry C|
|00006370| 68 72 69 73 74 6d 61 73 | 21 0d 0d 20 20 20 20 20 |hristmas|!.. |
|00006380| 20 20 20 20 20 70 72 69 | 6e 74 20 3c 3c 60 45 4f | pri|nt <<`EO|
|00006390| 43 60 3b 20 20 20 20 20 | 20 23 20 65 78 65 63 75 |C`; | # execu|
|000063a0| 74 65 20 63 6f 6d 6d 61 | 6e 64 73 0d 20 20 20 20 |te comma|nds. |
|000063b0| 20 65 63 68 6f 20 68 69 | 20 74 68 65 72 65 0d 20 | echo hi| there. |
|000063c0| 20 20 20 20 65 63 68 6f | 20 6c 6f 20 74 68 65 72 | echo| lo ther|
|000063d0| 65 0d 20 20 20 20 20 45 | 4f 43 0d 0d 20 20 20 20 |e. E|OC.. |
|000063e0| 20 20 20 20 20 20 70 72 | 69 6e 74 20 3c 3c 66 6f | pr|int <<fo|
|000063f0| 6f 2c 20 3c 3c 62 61 72 | 3b 20 23 20 79 6f 75 20 |o, <<bar|; # you |
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.